blob: c48da55c79d245e4c1d2899f81bee0d89ca796f4 [file] [log] [blame]
Akron30ee5142015-06-26 01:50:14 +02001% 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 Diewaldfccfbcb2015-04-29 20:48:19 +00006<li data-corpus-id="<%= $match->{corpusID} %>"
7 data-doc-id="<%= $match->{docID} %>"
Nils Diewald87507832015-05-01 23:36:41 +00008 data-text-id="<%= $match->{textID} %>"
Akron30ee5142015-06-26 01:50:14 +02009 data-match-id="<%= $match->{matchID} %>"
Nils Diewaldfccfbcb2015-04-29 20:48:19 +000010 %# TODO: This needs to be retrieved per match
Akron30ee5142015-06-26 01:50:14 +020011 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 Diewaldfccfbcb2015-04-29 20:48:19 +000013 id="<%= $id %>"\
14<% if (current_route eq 'match') { %> class="active"<% } =%>>
Nils Diewald4af3f0b2014-06-25 01:43:17 +000015 <div>
Akron0669f2f2015-05-28 20:27:09 +020016 <div class="flag"></div>
Nils Diewaldfccfbcb2015-04-29 20:48:19 +000017%# --- Snippet
Nils Diewald791b5902014-12-04 04:47:24 +000018 <div class="snippet<%= $match->{startMore} ? ' startMore' : '' %><%= $match->{endMore} ? ' endMore' : '' %>"><%== $match->{snippet} %></div>
Nils Diewald4af3f0b2014-06-25 01:43:17 +000019 </div>
Nils Diewald996aa552014-12-02 03:26:44 +000020%# -- Reference string
Nils Diewaldfccfbcb2015-04-29 20:48:19 +000021 <p class="ref">\
22<% if ($match->{title}) { %><strong><%= $match->{title} %></strong><% }; %>\
23<%= $match->{author} ? ' ' . loc('by') . ' ' . $match->{author} : '' %>\
Akron30ee5142015-06-26 01:50:14 +020024% if ($match->{pubDate}) {
25 (<time datetime="<%= $match->{pubDate} %>"><%= $match->{pubDate} %></time>)\
26% };
Nils Diewald996aa552014-12-02 03:26:44 +000027</p>
Nils Diewald4af3f0b2014-06-25 01:43:17 +000028</li>