-
Notifications
You must be signed in to change notification settings - Fork 305
/
single.html
702 lines (642 loc) · 30.8 KB
/
single.html
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
{{ define "meta" }}
{{ $volume_id := index (split .Params.anthology_id "-") 0 }}
{{ $paper := index (index .Site.Data.papers $volume_id) .Params.anthology_id }}
<meta content="{{ $paper.title }}" name="citation_title" >
{{ range $paper.author }}
{{ $first_letter := slicestr .id 0 1 }}
<meta content="{{ (index $.Site.Data.people $first_letter .id).full }}" name="citation_author" >
{{ end }}
{{ with $paper.parent_volume_id }}
{{ $volume := index $.Site.Data.volumes . }}
{{ if isset $volume "meta_journal_title" }}
<meta content="{{ $volume.meta_journal_title }}" name="citation_journal_title" >
{{ else }}
<meta content="{{ $volume.title }}" name="citation_conference_title" >
{{ end }}
{{ with $volume.meta_volume }}<meta content="{{ . }}" name="citation_volume" >{{ end }}
{{ with $volume.meta_issue }}<meta content="{{ . }}" name="citation_issue" >{{ end }}
{{ with $volume.meta_date }}<meta content="{{ . }}" name="citation_publication_date" >{{ end }}
{{ end }}
{{ with $paper.pdf }}
<meta content="{{ . }}" name="citation_pdf_url" >
{{ end }}
{{ with $paper.page_first }}<meta content="{{ . }}" name="citation_firstpage" >{{ end }}
{{ with $paper.page_last }}<meta content="{{ . }}" name="citation_lastpage" >{{ end }}
{{ with $paper.doi }}<meta content="{{ . }}" name="citation_doi" >{{ end }}
<meta property="og:title" content="{{ $paper.title }}" />
{{ with $paper.thumbnail }}
<meta property="og:image" content="{{ . }}" />
<meta property="og:image:alt" content="First page of paper PDF." />
{{ end }}
<meta property="og:type" content="article" />
<meta property="og:site_name" content="ACL Anthology" />
<meta property="og:url" content="{{ $paper.url }}" />
<meta property="og:description" content="{{ $paper.author_string }}. {{ $paper.booktitle }}. {{ $paper.year }}." />
<link rel="canonical" href="{{ $paper.url }}" />
{{ end }}
{{ define "javascript" }}
{{ $anthology_id := .Params.anthology_id }}
{{ $volume_id := index (split .Params.anthology_id "-") 0 }}
{{ $paper := index (index .Site.Data.papers $volume_id) .Params.anthology_id }}
<script src="{{ "/js/clipboard.min.js" | relURL }}"></script>
<script>
$( document ).ready(function() {
if (ClipboardJS.isSupported()) {
success_fn = function(e) {
// turns button into "copy successful"-style for 2 seconds
var src = $(e.trigger);
src.toggleClass("btn-success");
src.children("i").toggleClass("far fa-clipboard fas fa-clipboard-check");
e.clearSelection();
setTimeout(function() {
src.toggleClass("btn-success");
src.children("i").toggleClass("far fa-clipboard fas fa-clipboard-check");
}, 2000);
};
var clipboard = new ClipboardJS(".btn-clipboard");
clipboard.on('success', success_fn);
$(".btn-clipboard").removeClass("d-none");
// buttons outside the "cite" popup can't copy the content the usual way
// because the content element is hidden at the time; therefore we fetch
// and return the text to be copied manually
var clipboard_outside = new ClipboardJS(".btn-clipboard-outside", {
text: function(trigger) {
var target = trigger.getAttribute("data-clipboard-target");
return $(target).text();
}
});
clipboard_outside.on('success', success_fn);
$(".btn-clipboard-outside").removeClass("d-none");
}
});
const paper_params = {
anthology_id: "{{ .Params.anthology_id }}",
title: "{{ $paper.title_raw }}",
authors: [
{{ range $paper.author }}
{
first: "{{ .first }}",
last: "{{ .last }}",
id: "{{ .id }}"
},
{{ end }}
],
abstract: "{{ $paper.abstract_raw }}"
};
// Initial authors data
function showMetadataDialog() {
// Populate the modal with current values
document.getElementById("paperIdSpan").textContent = paper_params.anthology_id;
document.getElementById("paperTitle").value = paper_params.title;
document.getElementById("paperAbstract").value = paper_params.abstract;
const container = document.getElementById("authorsContainer");
container.innerHTML = "";
paper_params.authors.forEach((author, idx) => {
container.appendChild(createAuthorRow(author.first, author.last, author.id));
});
const modal = new bootstrap.Modal(document.getElementById('metadataModal'));
modal.show();
}
// Just call Sortable on your container after you’ve populated it:
new Sortable(document.getElementById('authorsContainer'), {
animation: 150, // a nice animation
ghostClass: 'sortable-ghost'
});
// Dragstart: store the element being dragged
authorsContainer.addEventListener('dragstart', (e) => {
const row = e.target.closest('.author-row');
if (row) {
draggedElement = row;
e.dataTransfer.effectAllowed = 'move';
e.dataTransfer.setData('text/plain', 'reordering'); // required to initiate drag
}
});
// Dragover: allow drop
authorsContainer.addEventListener('dragover', (e) => {
e.preventDefault();
e.dataTransfer.dropEffect = 'move';
});
// Drop: Insert the dragged element before the hovered row if found
authorsContainer.addEventListener('drop', (e) => {
e.preventDefault();
const targetRow = e.target.closest('.author-row');
if (targetRow && targetRow !== draggedElement) {
authorsContainer.insertBefore(draggedElement, targetRow);
} else if (!targetRow) {
// If dropped outside any specific row, append to the end
authorsContainer.appendChild(draggedElement);
}
draggedElement = null;
});
function createAuthorRow(first, last, id) {
// Create the container for the entire row
const row = document.createElement('div');
row.className = 'row g-0 g-lg-2 mb-2 author-row align-items-center';
row.draggable = true;
row.ondragstart = dragAuthor;
// Group drag handle and first name column
const grabberCol = document.createElement('div');
grabberCol.className = 'col-auto pe-1';
const handle = document.createElement('span');
handle.className = 'drag-handle';
handle.textContent = '⋮';
handle.style = "padding: 0 2px";
// Note: If you don't want to restrict dragging to the handle, remove handle.draggable
handle.draggable = true;
grabberCol.appendChild(handle);
// First name column
const firstNameCol = document.createElement('div');
firstNameCol.className = 'col-10 col-lg-4';
const firstName = document.createElement('input');
firstName.type = 'text';
firstName.placeholder = 'First name';
firstName.className = 'form-control';
firstName.value = first;
firstNameCol.appendChild(firstName);
grabberCol.appendChild(firstNameCol);
// Last name column
const lastNameCol = document.createElement('div');
lastNameCol.className = 'col-10 col-lg-4 mt-2 mt-lg-0';
const lastName = document.createElement('input');
lastName.type = 'text';
lastName.placeholder = 'Last name';
lastName.className = 'form-control';
lastName.value = last;
lastNameCol.appendChild(lastName);
// Add a hidden form control for author ID
const idInput = document.createElement('input');
idInput.type = 'hidden';
idInput.value = id;
lastNameCol.appendChild(idInput);
// Delete button column
const delCol = document.createElement('div');
delCol.className = 'col-auto ms-lg-auto text-end';
const delBtn = document.createElement('button');
delBtn.type = 'button';
delBtn.className = 'btn btn-sm btn-danger';
delBtn.textContent = 'X';
delBtn.onclick = () => row.remove();
delCol.appendChild(delBtn);
// Append all columns to the row
row.appendChild(grabberCol);
row.appendChild(firstNameCol);
row.appendChild(lastNameCol);
row.appendChild(delCol);
return row;
}
function addAuthor() {
const container = document.getElementById('authorsContainer');
container.appendChild(createAuthorRow("", "", "", ""));
}
// Drag & Drop functions for authors
let draggedAuthor = null;
function dragAuthor(ev) {
ev.dataTransfer.setData('text/plain', '');
draggedAuthor = ev.currentTarget;
}
function allowDrop(ev) {
ev.preventDefault();
}
function dropAuthor(ev) {
ev.preventDefault();
if (ev.target.id === "authorsContainer" || ev.target.parentNode.id === "authorsContainer") {
const container = document.getElementById("authorsContainer");
// Insert before the target row if we dropped on a row, otherwise at the end
if (ev.target.classList && ev.target.classList.contains('author-row')) {
container.insertBefore(draggedAuthor, ev.target);
} else if (ev.target.parentNode.classList && ev.target.parentNode.classList.contains('author-row')) {
container.insertBefore(draggedAuthor, ev.target.parentNode);
} else {
container.appendChild(draggedAuthor);
}
}
}
// New function to handle submission
function submitMetadataCorrection() {
// make sure the pdfCorrectionCheck box is checked
if (!document.getElementById("pdfCorrectionCheck").checked) {
alert("Please check the box to confirm that these changes match the PDF.");
return;
}
const newTitle = document.getElementById("paperTitle").value;
const newAbstract = document.getElementById("paperAbstract").value;
const authorRows = document.querySelectorAll("#authorsContainer .author-row");
const newAuthors = [];
authorRows.forEach(row => {
const inputs = row.querySelectorAll("input");
newAuthors.push({
"first": inputs[0].value,
"last": inputs[1].value,
"id": inputs[2].value
});
});
// Compare original values to current values
const updatedParams = {
anthology_id: paper_params.anthology_id
}
if (newTitle !== paper_params.title) {
updatedParams.title = newTitle;
}
if (newAbstract !== paper_params.abstract) {
updatedParams.abstract = newAbstract;
}
const oldAuthorString = JSON.stringify(paper_params.authors);
const newAuthorString = JSON.stringify(newAuthors);
if (newAuthorString != oldAuthorString) {
updatedParams.authors = newAuthors;
}
if (Object.keys(updatedParams).length === 1) {
// ensure it's not just the anthology_id in the dictionary
alert("No changes detected.");
return;
}
// Same assembly as original code
const baseurl = "https://github.com/acl-org/acl-anthology/issues/new?template=99-bulk-metadata-correction.yml";
const issue_title = "Metadata correction for {{ .Params.anthology_id}}";
const labels = "metadata,correction";
const who = "anthology-assist";
const param_string = "```json\n" + JSON.stringify(updatedParams, null, 2) + "\n```";
const url = baseurl + `&title=${encodeURIComponent(issue_title)}&assignee=${encodeURIComponent(who)}&labels=${encodeURIComponent(labels)}&data=` + encodeURIComponent(param_string);
window.open(url, "_blank");
}
</script>
{{ end }}
{{ define "main" }}
{{ $anthology_id := .Params.anthology_id }}
{{ $volume_id := index (split .Params.anthology_id "-") 0 }}
{{ $paper := index (index .Site.Data.papers $volume_id) .Params.anthology_id }}
{{ $has_bib := fileExists (printf "/data-export/%s.bib" $anthology_id) }}
{{ $has_xml := fileExists (printf "/data-export/%s.xml" $anthology_id) }}
{{ $has_endf := fileExists (printf "/data-export/%s.endf" $anthology_id) }}
<section id="main">
<div>
<h2 id="title">
{{ with $paper.pdf }}
<a href="{{ . }}">{{ $paper.title_html | safeHTML }}</a>
{{ else }}
{{ $paper.title_html | safeHTML }}
{{ end }}
</h2>
{{ with $paper.author }}
<p class="lead">
{{ $len := (len .) }}
{{ range $index, $person := . }}
{{ partial "author_link.html" (dict "ctx" $ "person" $person) | chomp }}{{ if ne (add $index 1) $len }}, {{ end }}
{{ end }}
{{ end }}
</p>
</div>
<div class="modal fade" id="metadataModal" tabindex="-1" aria-labelledby="metadataModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Correct Metadata for <span id="paperIdSpan"></span></h5>
<button class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form id="metadataForm">
<div class="alert alert-info" role="alert">
<b>Important</b>: The Anthology treat PDFs as authoritative. Please use this form only to correct data that is out of line with the PDF. See <a href="https://aclanthology.org/info/corrections/">our corrections guidelines</a> if you need to change the PDF.
</div>
<div class="mb-3">
<label for="paperTitle" class="form-label">Title</label>
<small id="paperTitleHelp" class="form-text text-muted">Adjust the title. Retain tags such as <fixed-case>.</small>
<input type="text" class="form-control" id="paperTitle">
</div>
<label class="form-label">Authors</label>
<small id="authorTitleHelp" class="form-text text-muted">Adjust author names and order to match the PDF.</small>
<div id="authorsContainer" class="px-3" ondrop="dropAuthor(event)" ondragover="allowDrop(event)"></div>
<button type="button" class="btn btn-secondary btn-sm mb-3" onclick="addAuthor()">Add Author</button>
<div class="mb-3">
<label for="paperAbstract" class="form-label">Abstract</label>
<small id="abstractTitleHelp" class="form-text text-muted">Correct abstract if needed. Retain XML formatting tags such as <tex-math>.</small>
<textarea class="form-control" id="paperAbstract" rows="6"></textarea>
</div>
</form>
</div>
<div class="modal-footer d-flex align-items-center">
<div class="form-check mb-0">
<input type="checkbox" class="form-check-input" id="pdfCorrectionCheck">
<label class="form-check-label" for="pdfCorrectionCheck">ALL author names, the title, and the abstract match the PDF</label>
</div>
<button type="button" class="btn btn-primary" onclick="submitMetadataCorrection()">Submit</button>
</div>
</div>
</div>
</div>
<hr />
<div class="row acl-paper-details">
<div class="col col-lg-10 order-2">
{{ with $paper.retracted }}
<div class="alert alert-danger" role="alert">
<b>This paper has been retracted.</b> {{ . }}
</div>
{{ end }}
{{ with $paper.removed }}
<div class="alert alert-danger" role="alert">
<b>This paper has been <a href="https://aclanthology.org/info/corrections/#removal">removed</a>.</b>
{{ . }}
</div>
{{ end }}
{{ with $paper.abstract_html }}
<div class="card bg-light mb-2 mb-lg-3">
<div class="card-body acl-abstract">
<h5 class="card-title">Abstract</h5>
<span {{ with $paper.retracted }} style="text-decoration: line-through" {{ end }}>
{{ . | safeHTML }}
</span>
</div>
</div>
{{ end }}
<!-- To avoid cluttering this template with Bootstrap classes, the styling
for this list is defined in assets/css/_papers.scss -->
<dl>
<dt>Anthology ID:</dt>
<dd>{{ $anthology_id }}</dd>
{{ range $paper.revision }}
{{ if eq .id "1" }}
<dt>Original:</dt>
{{ else }}
<dt>Version {{ .id }}:</dt>
{{ end }}
<dd><a href="{{ .url }}">{{ .value }}</a></dd>
{{ end }}
{{ range $paper.erratum }}
<dt>Erratum e{{ .id }}:</dt>
<dd><a href="{{ .url }}">{{ .value }}</a></dd>
{{ end }}
<dt>Volume:</dt>
<dd>
{{- with $paper.parent_volume_id -}}
{{ $volume := index $.Site.Data.volumes . }}
{{ $volume_page := printf "/volumes/%s" . }}
<a href="{{ relref $ $volume_page }}">{{ $volume.title }}</a>
{{- end -}}
</dd>
<dt>Month:</dt>
<dd>{{ with $paper.month }}{{ . }}{{ end }}</dd>
<dt>Year:</dt>
<dd>{{ with $paper.year }}{{ . }}{{ end }}</dd>
<dt>Address:</dt>
<dd>{{ with $paper.address }}{{ . }}{{ end }}</dd>
{{ with $paper.editor }}
{{ $len := (len .) }}
<dt>Editor{{ if gt $len 1 }}s{{ end }}:</dt>
<dd>
{{ range $index, $person := . }}
{{ partial "author_link.html" (dict "ctx" $ "person" $person) | chomp }}{{ if ne (add $index 1) $len }}, {{ end }}
{{ end }}
</dd>
{{ end }}
{{ with $paper.parent_volume_id }}
{{ $volume := index $.Site.Data.volumes . }}
<dt>{{ if gt (len $volume.venues) 1 }}Venues:{{ else }}Venue:{{ end }}</dt>
<dd>
{{- $len := (len $volume.venues) -}}
{{- range $index, $venue := $volume.venues -}}
{{ $acronym := index $.Site.Data.venues $venue "acronym" }}
<a href="{{ relref $ (printf "/venues/%s" ($venue)) }}">
{{- $acronym -}}
</a>
{{ if ne (add $index 1) $len }} | {{ end }}
{{- end -}}
</dd>
<dt>{{ if gt (len $volume.sigs) 1 }}SIGs:{{ else }}SIG:{{ end }}</dt>
<dd>
{{- $len := (len $volume.sigs) -}}
{{- range $index, $sig := $volume.sigs -}}
{{ $slug := index $.Site.Data.sigs $sig "slug" }}
<a href="{{ relref $ (printf "/sigs/%s" $slug) }}">{{ $sig }}</a>
{{ if ne (add $index 1) $len }} | {{ end }}
{{- end -}}
</dd>
{{ end }}
<dt>Publisher:</dt>
<dd>{{ with $paper.publisher }}{{ . }}{{ end }}</dd>
<dt>Note:</dt>
<dd>{{ with $paper.note }}{{ . }}{{ end }}</dd>
<dt>Pages:</dt>
<dd>{{ with $paper.pages }}{{ . }}{{ end }}</dd>
<dt>Language:</dt>
<dd>{{ with $paper.language }}{{ . }}{{ end }}</dd>
<dt>URL:</dt>
<dd><a href="{{ $paper.url }}">{{ $paper.url }}</a></dd>
<dt>DOI:</dt>
<dd>{{ with $paper.doi }}<a href="https://doi.org/{{ . }}" title="To the current version of the paper by DOI">{{ . }}</a>{{ end }}</dd>
{{ range $paper.award }}
<dt>Award:</dt>
<dd><i class="fas fa-award"></i> {{ . }}</dd>
{{ end }}
<!--
<dt>Bibtype:</dt>
<dd>{{ with $paper.bibtype }}{{ . }}{{ end }}</dd>
-->
{{ if and (not $paper.retracted) (not $paper.removed) }}
<dt class="acl-button-row">Bibkey:</dt>
<dd class="acl-button-row">{{ with $paper.bibkey }}<button type="button" class="btn btn-clipboard-outside btn-secondary btn-sm d-none" data-clipboard-target="#citePaperBibkey"><i class="far fa-clipboard"></i><span id="citePaperBibkey" class="pl-2 text-monospace">{{ . }}</span></button>{{ end }}</dd>
{{ with $paper.citation_acl }}
<dt>Cite (ACL):</dt><dd><span id="citeACL">{{ safeHTML . }}</span><button type="button" class="btn btn-clipboard btn-secondary btn-sm d-none ml-2" data-clipboard-target="#citeACL"><i class="far fa-clipboard"></i></button></dd>
{{ end }}
{{ with $paper.citation }}
<dt>Cite (Informal):</dt><dd><span id="citeRichText">{{ markdownify . }}</span><button type="button" class="btn btn-clipboard btn-secondary btn-sm d-none ml-2" data-clipboard-target="#citeRichText"><i class="far fa-clipboard"></i></button></dd>
{{ end }}
<dt class="acl-button-row">Copy Citation:</dt>
<dd class="acl-button-row">
{{ if $has_bib }}
<button type="button" class="btn btn-clipboard-outside btn-secondary btn-sm d-none" data-clipboard-target="#citeBibtexContent"><i class="far fa-clipboard pr-2"></i>BibTeX</button>
{{ end }}
<button type="button" class="btn btn-clipboard-outside btn-secondary btn-sm d-none" data-clipboard-target="#citeMarkdownContent"><i class="far fa-clipboard pr-2"></i>Markdown</button>
{{ if $has_xml }}
<button type="button" class="btn btn-clipboard-outside btn-secondary btn-sm d-none" data-clipboard-target="#citeModsContent"><i class="far fa-clipboard pr-2"></i>MODS XML</button>
{{ end }}
{{ if $has_endf }}
<button type="button" class="btn btn-clipboard-outside btn-secondary btn-sm d-none" data-clipboard-target="#citeEndnoteContent"><i class="far fa-clipboard pr-2"></i>Endnote</button>
{{ end }}
<button type="button" class="btn btn-secondary btn-sm" data-toggle="modal" data-target="#citeModal">More options…</button>
</dd>
{{ end }} <!-- if not $paper.retracted -->
{{ with $paper.pdf }}
<dt>PDF:</dt><dd><a href="{{ . }}">{{ . }}</a></dd>
{{ end }}
{{ range $paper.attachment }}
<dt class="acl-button-row">{{ humanize .type }}:</dt>
<dd class="acl-button-row"><a href="{{ .url }}" class="btn btn-attachment btn-sm">{{ partial "attachment_repr.html" . }} {{ .filename }}</a></dd>
{{ end }}
{{ range $paper.video }}
<dt class="acl-button-row">Video:</dt>
<dd class="acl-button-row"><a href="{{ . }}" class="btn btn-attachment btn-sm"><i class="fas fa-video"></i> {{ . }}</a></dd>
{{ end }}
{{ with $paper.pwccode }}
<dt>Code</dt>
<dd>
{{ if .url }}
<a href="{{ .url }}">
{{- if in .url "github.com/" -}}
<i class="fab fa-github"></i>
{{- else if in .url "gitlab.com/" -}}
<i class="fab fa-gitlab"></i>
{{- else if in .url "bitbucket" -}}
<i class="fab fa-bitbucket"></i>
{{- end -}} {{ .name }}
</a>
{{ end }}
{{ if (and (eq .additional "true") .url) }}
+
{{ end }}
{{ if eq .additional "true" }}
<a href="https://paperswithcode.com/paper/?acl={{ $anthology_id }}"><svg xmlns="http://www.w3.org/2000/svg" class="pwc-icon" viewBox="0 0 512 512"><path stroke="#4d8093" fill="#4d8093" d="M88 128h48v256H88zM232 128h48v256h-48zM160 144h48v224h-48zM304 144h48v224h-48zM376 128h48v256h-48z"></path><path stroke="#4d8093" fill="#4d8093" d="M104 104V56H16v400h88v-48H64V104zM408 56v48h40v304h-40v48h88V56z"></path></svg> additional community code
</a>
{{ end }}
</dd>
{{ end }}
{{ with $paper.pwcdataset }}
<dt>Data</dt>
<dd>
{{ range $i, $t := . }}{{ if $i }}, {{ end }}<a href="{{ $t.url }}">{{ $t.name }}</a>{{ end }}
</dd>
{{ end }}
</dl>
</div>
<!-- Most of the styling for this block is set in _papers.scss to avoid clutter -->
<div class="acl-paper-link-block">
{{ if isset $paper "revision" }}
{{ range last 1 $paper.revision }}
<a class="btn btn-primary" href="{{ .url }}" title="Open latest revision PDF of '{{ $paper.title | htmlEscape }}'">
<i class="far fa-file-pdf"></i><span class="pl-2">PDF <small>(v{{ .id }})</small></span>
</a>
{{ end }}
{{ range first 1 $paper.revision }}
<a class="btn btn-secondary" href="{{ .url }}" title="Open original PDF of '{{ $paper.title | htmlEscape }}'">
<i class="far fa-file-pdf"></i><span class="pl-2">PDF <small>(v{{ .id }})</small></span>
</a>
{{ end }}
{{ else }}
{{ with $paper.pdf }}
<a class="btn btn-primary" href="{{ . }}" title="Open PDF of '{{ $paper.title | htmlEscape }}'">
<i class="far fa-file-pdf"></i><span class="pl-2">PDF</span>
</a>
{{ end }}
{{ end }}
{{ if and (not $paper.retracted) (not $paper.removed) (or $has_bib $has_xml $has_endf) }}
<a class="btn btn-secondary" title="Open dialog for exporting citations" data-toggle="modal" data-target="#citeModal" href="#">
<i class="fas fa-quote-left"></i><span class="pl-2">Cite</span>
</a>
{{ end }}
<a class="btn btn-secondary" href="https://www.semanticscholar.org/search?{{ (querify "q" $paper.title) | safeURL }}" title="Search for '{{ $paper.title | htmlEscape }}' on Semantic Scholar">
<i class="ai ai-semantic-scholar"></i><span class="pl-sm-2 d-none d-sm-inline">Search</span>
</a>
{{ with $paper.pwccode }}
{{ if (or (eq .additional "true") .url) }}
<a class="btn btn-secondary d-flex flex-wrap justify-content-center" href="https://paperswithcode.com/paper/?acl={{ $anthology_id }}" title="Code for '{{ $paper.title | htmlEscape }}' on Papers with Code">
<svg xmlns="http://www.w3.org/2000/svg" class="pwc-icon-big" viewBox="0 0 512 512"><path stroke="#4d8093" fill="#4d8093" d="M88 128h48v256H88zM232 128h48v256h-48zM160 144h48v224h-48zM304 144h48v224h-48zM376 128h48v256h-48z"></path><path stroke="#4d8093" fill="#4d8093" d="M104 104V56H16v400h88v-48H64V104zM408 56v48h40v304h-40v48h88V56z"></path></svg>
<span class="pl-sm-2 d-none d-sm-inline">Code</span>
</a>
{{ end }}
{{ end }}
{{ range $paper.attachment }}
<a class="btn btn-attachment d-flex flex-wrap justify-content-center" href="{{ .url }}" title="Open {{ .type | humanize | lower }} for '{{ $paper.title | htmlEscape }}'">
<span class="align-self-center px-1">{{ partial "attachment_repr.html" . -}}</span>
<span class="px-1">{{ humanize .type }}</span>
</a>
{{ end }}
{{ range $paper.video }}
<a class="btn btn-attachment d-flex flex-wrap justify-content-center" href="{{ . }}" title="Open video for '{{ $paper.title | htmlEscape }}'">
<span class="align-self-center px-1"><i class="fas fa-video"></i></span>
<span class="px-1">Video</span>
</a>
{{ end }}
<a class="btn btn-warning d-flex flex-wrap justify-content-center" href=# title="Correct problems with title, author list, and abstract" onclick="showMetadataDialog()">
<span class="d-none d-sm-inline"><i class="fas fa-edit"></i></span>
<span class="pl-md-2">Fix data</span>
</a>
</div>
</div>
<hr />
<div class="modal fade" id="citeModal" tabindex="-1" role="dialog" aria-labelledby="citeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="citeModalLabel">Export citation</h5>
<button class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<ul class="nav nav-tabs mb-2" id="citeFormats" role="tablist">
<li class="nav-item">
<a class="nav-link {{ if not $has_bib }}disabled{{ else }}active{{ end }}" data-toggle="list" href="#citeBibtex" role="tab" aria-controls="citeBibtex" aria-selected="{{ if $has_bib }}true{{ else }}false{{ end }}">BibTeX</a>
</li>
<li class="nav-item">
<a class="nav-link {{ if not $has_xml }}disabled{{ end }}" data-toggle="list" href="#citeMods" role="tab" aria-controls="citeMods" aria-selected="false">MODS XML</a>
</li>
<li class="nav-item">
<a class="nav-link {{ if not $has_endf }}disabled{{ end }}" data-toggle="list" href="#citeEndnote" role="tab" aria-controls="citeEndnote" aria-selected="false">Endnote</a>
</li>
<li class="nav-item">
<a class="nav-link {{ if not $has_bib }}active{{ end }}" data-toggle="list" href="#citeMarkdown" role="tab" aria-controls="citeMarkdown" aria-selected="{{ if $has_bib }}false{{ else }}true{{ end }}">Preformatted</a>
</li>
</ul>
<div class="tab-content" id="citeFormatsContent">
<div class="tab-pane active" id="citeBibtex" role="tabpanel">
{{- if $has_bib -}}
<pre id="citeBibtexContent" class="bg-light border p-2" style="max-height: 50vh;">
{{- readFile (printf "/data-export/%s.bib" $anthology_id) -}}
</pre>
<div class="modal-footer pb-1">
<a class="btn btn-secondary" href="{{ (printf "/%s.bib" $anthology_id) | relURL }}"><i class="fas fa-download pr-2"></i>Download as File</a>
<button class="btn btn-clipboard btn-primary d-none" data-clipboard-target="#citeBibtexContent"><i class="far fa-clipboard pr-2"></i>Copy to Clipboard</button>
</div>
{{- end -}}
</div>
<div class="tab-pane" id="citeMods" role="tabpanel">
{{- if $has_xml -}}
<pre id="citeModsContent" class="bg-light border p-2" style="max-height: 50vh;">
{{- readFile (printf "/data-export/%s.xml" $anthology_id) -}}
</pre>
<div class="modal-footer pb-1">
<a class="btn btn-secondary" href="{{ (printf "/%s.xml" $anthology_id) | relURL }}"><i class="fas fa-download pr-2"></i>Download as File</a>
<button class="btn btn-clipboard btn-primary d-none" data-clipboard-target="#citeModsContent"><i class="far fa-clipboard pr-2"></i>Copy to Clipboard</button>
</div>
{{- end -}}
</div>
<div class="tab-pane" id="citeEndnote" role="tabpanel">
{{- if $has_endf -}}
<pre id="citeEndnoteContent" class="bg-light border p-2" style="max-height: 50vh;">
{{- readFile (printf "/data-export/%s.endf" $anthology_id) -}}
</pre>
<div class="modal-footer pb-1">
<a class="btn btn-secondary" href="{{ (printf "/%s.endf" $anthology_id) | relURL }}"><i class="fas fa-download pr-2"></i>Download as File</a>
<button class="btn btn-clipboard btn-primary d-none" data-clipboard-target="#citeEndnoteContent"><i class="far fa-clipboard pr-2"></i>Copy to Clipboard</button>
</div>
{{- end -}}
</div>
<div class="tab-pane" id="citeMarkdown" role="tabpanel">
<h5>Markdown (Informal)</h5>
<p id="citeMarkdownContent" class="text-monospace small bg-light border p-2">
{{- $paper.citation -}}
</p>
<ul class="mt-2">
<li>{{- $paper.citation | markdownify -}}</li>
</ul>
{{ with $paper.citation_acl }}
<h5>ACL</h5>
<ul class="mt-2">
<li id="citeACLstyleContent">{{- $paper.citation_acl | safeHTML -}}</li>
</ul>
{{ end }}
<div class="modal-footer pb-1">
<button type="button" class="btn btn-clipboard btn-primary d-none" data-clipboard-target="#citeMarkdownContent"><i class="far fa-clipboard pr-2"></i>Copy Markdown to Clipboard</button>
{{ with $paper.citation_acl }}
<button type="button" class="btn btn-clipboard btn-primary d-none" data-clipboard-target="#citeACLstyleContent"><i class="far fa-clipboard pr-2"></i>Copy ACL to Clipboard</button>
{{ end }}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
{{ end }}