Akron | 30ee514 | 2015-06-26 01:50:14 +0200 | [diff] [blame] | 1 | % use Mojo::JSON qw/encode_json/; |
| 2 | % my $match = stash('match') || {}; |
| 3 | % my %match_data = %$match; |
| 4 | % delete @match_data{qw/snippet startMore endMore field/}; |
| 5 | % my $id = $match->{textSigle} . '#' . $match->{matchID}; |
Nils Diewald | fccfbcb | 2015-04-29 20:48:19 +0000 | [diff] [blame] | 6 | <li data-corpus-id="<%= $match->{corpusID} %>" |
| 7 | data-doc-id="<%= $match->{docID} %>" |
Nils Diewald | 8750783 | 2015-05-01 23:36:41 +0000 | [diff] [blame] | 8 | data-text-id="<%= $match->{textID} %>" |
Akron | 30ee514 | 2015-06-26 01:50:14 +0200 | [diff] [blame] | 9 | data-match-id="<%= $match->{matchID} %>" |
Nils Diewald | fccfbcb | 2015-04-29 20:48:19 +0000 | [diff] [blame] | 10 | %# TODO: This needs to be retrieved per match |
Akron | 30ee514 | 2015-06-26 01:50:14 +0200 | [diff] [blame] | 11 | data-available-info="<%= $match->{layerInfos} // $match->{layerInfo} // 'cnx/c=spans corenlp/ne=tokens corenlp/p=tokens mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens tt/l=tokens tt/p=tokens xip/c=spans' %>" |
| 12 | data-info="<%== b(encode_json(\%match_data))->decode->xml_escape %>" |
Nils Diewald | fccfbcb | 2015-04-29 20:48:19 +0000 | [diff] [blame] | 13 | id="<%= $id %>"\ |
| 14 | <% if (current_route eq 'match') { %> class="active"<% } =%>> |
Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 15 | <div> |
Akron | 0669f2f | 2015-05-28 20:27:09 +0200 | [diff] [blame] | 16 | <div class="flag"></div> |
Nils Diewald | fccfbcb | 2015-04-29 20:48:19 +0000 | [diff] [blame] | 17 | %# --- Snippet |
Nils Diewald | 791b590 | 2014-12-04 04:47:24 +0000 | [diff] [blame] | 18 | <div class="snippet<%= $match->{startMore} ? ' startMore' : '' %><%= $match->{endMore} ? ' endMore' : '' %>"><%== $match->{snippet} %></div> |
Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 19 | </div> |
Nils Diewald | 996aa55 | 2014-12-02 03:26:44 +0000 | [diff] [blame] | 20 | %# -- Reference string |
Nils Diewald | fccfbcb | 2015-04-29 20:48:19 +0000 | [diff] [blame] | 21 | <p class="ref">\ |
| 22 | <% if ($match->{title}) { %><strong><%= $match->{title} %></strong><% }; %>\ |
| 23 | <%= $match->{author} ? ' ' . loc('by') . ' ' . $match->{author} : '' %>\ |
Akron | 30ee514 | 2015-06-26 01:50:14 +0200 | [diff] [blame] | 24 | % if ($match->{pubDate}) { |
| 25 | (<time datetime="<%= $match->{pubDate} %>"><%= $match->{pubDate} %></time>)\ |
| 26 | % }; |
Nils Diewald | 996aa55 | 2014-12-02 03:26:44 +0000 | [diff] [blame] | 27 | </p> |
Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 28 | </li> |