Skip to content

Commit 8f5a536

Browse files
committed
Addded format_email helper to aplication_helper.rb
Changed email formatting in the reports listed below by calling format_email `
1 parent f815a14 commit 8f5a536

File tree

5 files changed

+21
-16
lines changed

5 files changed

+21
-16
lines changed

app/helpers/application_helper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# Methods added to this helper will be available to all templates in the application.
22
module ApplicationHelper
3+
def format_email(email)
4+
%Q[<a href="mailto:#{email}?subject=CLTP - ">#{email}</a>]
5+
# "mailto:#{email}?subject=CLTP - ">#{email}
6+
end
37
end

app/views/reports/dx_by_students.html.erb

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,21 @@
2020
<tbody>
2121
<% rows = @reportarray[1]
2222
for arow in rows do
23-
cls_rest = cycle("bg5","bg4", :name => 'rest_cols')
24-
cls_col_1 = cycle("bg8","bg7", :name => 'first_col')
23+
cls_rest = cycle("bg5","bg4", :name => 'rest_cols')
24+
cls_col_1 = cycle("bg8","bg7", :name => 'first_col')
2525
%>
26-
<tr>
27-
<!-- The following two lines of Ruby are to pop off the first three
28-
elements which contain the first name, last name & username -->
29-
<td class="b1 <%= cls_col_1 %>"> <%= arow.shift %> </td>
30-
<td class="b1 <%= cls_col_1 %>"> <%= arow.shift %> </td>
31-
<td class="b1 <%= cls_col_1 %>"> <%= arow.shift %> </td>
26+
<tr>
27+
<!-- The following two lines of Ruby are to pop off the first three
28+
elements which contain the first name, last name & username -->
29+
<td class="b1 <%= cls_col_1 %>"> <%= arow.shift %> </td>
30+
<td class="b1 <%= cls_col_1 %>"> <%= arow.shift %> </td>
31+
<td class="b1 <%= cls_col_1 %>"><%= format_email(arow.shift) %></td>
32+
3233

33-
<% for aval in arow do %>
34-
<td class="b1 datacenter <%= cls_rest %>"> <%= aval %></td>
35-
<% end %>
36-
</tr>
34+
<% for aval in arow do %>
35+
<td class="b1 datacenter <%= cls_rest %>"> <%= aval %></td>
36+
<% end %>
37+
</tr>
3738
<% end %>
3839

3940
</tbody>
@@ -55,7 +56,7 @@ $(function() {
5556
"bJQueryUI": true,
5657
"bPaginate": true,
5758
"aaSorting": [[1,"asc"]],
58-
"aoColumns": [null,null,null,{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" }],
59+
"aoColumns": [null,null,{ "sType": "noSel","sWidth": "200"},{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" },{ "sType": "numeric" }],
5960
"iDisplayLength": 25,
6061
"sPaginationType" : "full_numbers"
6162
} );

app/views/reports/encounters_by_care_settings.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<tr>
2727
<td class="b1 <%= cls_col_1 %>"> <%= reportline["FirstName"] %> </td>
2828
<td class="b1 <%= cls_col_1 %>"> <%= reportline["LastName"] %> </td>
29-
<td class="b1 <%= cls_col_1 %>"> <%= reportline["Email"] %> </td>
29+
<td class="b1 <%= cls_col_1 %>"> <%= format_email(reportline["Email"]) %> </td>
3030
<td class="b1 datacenter <%= cls_rest %>"> <%= reportline["Inpatient"] %> </td>
3131
<td class="b1 datacenter <%= cls_rest %>"> <%= reportline["Outpatient"] %> </td>
3232
<td class="b1 datacenter <%= cls_rest %>"> <%= reportline["Newborn"] %> </td>

app/views/reports/hnp_observed_vs_performed.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<tr>
2929
<td class="b1 <%= cls_col_1 %>"> <%= reportline["FirstName"] %> </td>
3030
<td class="b1 <%= cls_col_1 %>"> <%= reportline["LastName"] %> </td>
31-
<td class="b1 <%= cls_col_1 %>"> <%= reportline["Email"] %> </td>
31+
<td class="b1 <%= cls_col_1 %>"> <%= format_email(reportline["Email"]) %> </td>
3232
<td class="b1 datacenter <%= cls_rest %>"> <%= reportline["hxObserved"] %> </td>
3333
<td class="b1 datacenter <%= cls_rest %>"> <%= reportline["hxPerformed"] %> </td>
3434
<td class="b1 datacenter <%= cls_rest %>"> <%= reportline["pxObserved"] %> </td>

app/views/reports/student_table.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<td class="b1 <%= cls_rest %>"> <%= reportline.username %> </td>
2424
<td class="b1 <%= cls_rest %>"> <%= reportline.firstname %> </td>
2525
<td class="b1 <%= cls_rest %>"> <%= reportline.lastname %> </td>
26-
<td class="b1 <%= cls_rest %>"> <%= reportline.email %> </td>
26+
<td class="b1 <%= cls_rest %>"> <%= format_email(reportline.email) %> </td>
2727
<td class="b1 <%= cls_rest %>"> <%= reportline.last_login %> </td>
2828
<td class="b1 datacenter <%= cls_rest %>"> <%= reportline.login_count %> </td>
2929
</tr>

0 commit comments

Comments
 (0)