summaryrefslogtreecommitdiff
blob: 523bf250ad6fe82351c411f182f5486dbf8c61e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<h1 class="first-header">Gentoo Archives: <%= list %></h1>

<div class="table-responsive">
  <table class="table table-condensed ag-header-table">
    <tr>
      <th class="ag-header-name-col">From:</th>
      <td><%= h strip_email_headers(message['_source']['from']).first %></td>
    </tr>
    <tr>
      <th>To:</th>
      <td><%= h strip_email_headers(message['_source']['to']).join ', ' %></td>
    </tr>
    <% unless message['_source']['cc'] == nil or message['_source']['cc'] == [] %>
    <tr>
      <th>Cc:</th>
      <td><%= h strip_email_headers(message['_source']['cc']).join ', ' %></td>
    </tr>
    <% end %>
    <tr>
      <th>Subject:</th>
      <td><strong><%= h message['_source']['subject'] %></strong></td>
    </tr>
    <tr>
      <th>Date:</th>
      <td><%= date_format message['_source']['date'] %></td>
    </tr>
    <tr>
      <th>Message-Id:</th>
      <td><tt><%= h message['_source']['raw_message_id'] %></tt></td>
    </tr>
    <% unless parent == nil %>
    <tr>
      <th>In Reply to:</th>
      <td colspan="3"><a href="<%= parent['_id'] %>"><%= parent['_source']['subject'] %></a> by <%= parent['_source']['from'] %></td>
    </tr>
    <% end %>
  </table>
</div>

<pre class="ag-message-content">
<%= linkize(strip_email(message['_source']['content'])) %>
</pre>

<% if message['_source']['attachments'] and not message['_source']['attachments'].empty? %>
<h3>Attachments</h3>

<div class="table-responsive">
  <table class="table table-condensed ag-attachment-table">
    <tr>
      <th>File name</th>
      <th>MIME type</th>
    </tr>
    <% message['_source']['attachments'].each do |attachment| %>
      <tr>
        <td><%= h attachment['filename'] %></td>
        <td><%= h attachment['mime'] %></td>
      </tr>
    <% end %>
  </table>
</div>
<% end %>

<% unless children == nil %>
<h3>Replies</h3>

<div class="table-responsive">
  <table class="table table-condensed ag-replies-table">
    <tr>
      <th>Subject</th>
      <th>Author</th>
    </tr>
    <% children.each do |child| %>
      <tr>
        <td><a href="<%= child['_id'] %>"><%= h child['_source']['subject'] %></a></td>
        <td><%= h strip_email_headers(child['_source']['from']).first %></td>
      </tr>
    <% end %>
  </table>
</div>
<% end %>

<div class="ag-message-actions">
  <a href="/<%= h list %>/report/<%= message['_id'] %>" class="btn btn-danger btn-xs"><span class="fa fa-fw fa-ban"></span> Report Message</a>
  <div class="btn-group btn-group-xs">
    <a href="<%= msgid_to_marc(message['_source']['raw_message_id']) %>" class="btn btn-default"><span class="fa fa-fw fa-share-square"></span>Find on MARC</a>
    <a href="<%= msgid_to_googlegroup(message['_source']['raw_message_id']) %>" class="btn btn-default"><span class="fa fa-fw fa-share-square"></span>Find on Google Groups</a>
  </div>
</div>