aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_web/templates/reference_match.html
blob: 08ab33fcad4143216d44127ea7154c9ab083dd42 (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
89
90
91
92
93
94
95
{% extends "base.html" %}
{% import "entity_macros.html" as entity_macros %}
{% import "edit_macros.html" as edit_macros %}

{% block body %}

<h1>Reference Fuzzy Match Tool</h1>

<form class="ui form" id="reference_match" method="POST" action="/reference/match">
  <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>

  <div class="ui segment">
    <h3>Parse Citation</h3>

    <p>Enter a citation string here and we will try to parse it (using GROBID)
    into a structured format, then match against the catalog.

    {{ edit_macros.form_field_basic(form.raw_citation) }}

    <button class="ui primary submit button right floated" type="submit" name="submit_type" value="parse">
      Parse
    </button>
    <br clear="all">
  </div>

  {% if grobid_status == "success" and grobid_dict %}
    <div class="ui positive message">
      <div class="header">Parsed Citation String</div>
      {{ entity_macros.extra_metadata(grobid_dict) }}
      <p><i>See below for fuzzy match results</i>
    </div>
  {% endif %}

  <div class="ui segment">
    <h3>Fuzzy Match Metadata</h3>

    <p>Enter whatever bibliographic metadata fields you know, and we will try to
    match to catalog entries.

    <p><b>NOTE:</b> if you already know a persistent identifier (like a DOI), you
    should use the <a href="/release/lookup">lookup tool</a> instead.

    <br>
    <div class="ui equal width fields">
      {{ edit_macros.form_field_basic(form.title) }}
    </div>
    <div class="ui equal width fields">
      {{ edit_macros.form_field_basic(form.first_author) }}
    </div>
    <div class="ui equal width fields">
      {{ edit_macros.form_field_basic(form.journal) }}
    </div>
    <div class="ui equal width fields">
      {{ edit_macros.form_field_basic(form.year) }}
      {{ edit_macros.form_field_basic(form.volume) }}
      {{ edit_macros.form_field_basic(form.issue) }}
      {{ edit_macros.form_field_basic(form.pages) }}
    </div>

    <button class="ui primary submit button right floated" type="submit" name="submit_type" value="match">
      Match
    </button>
    <br clear="all">
  </div>

</form>

{% if matches is defined %}
  <h3>Matched Releases</h3>

  {% if not matches %}
    <p><i>No matches found</i>
  {% endif %}

  <table class="ui very basic celled table">
  <tbody>
  {% for match in matches %}
    <tr><td class="collapsing center aligned">
          <br><b>{{ match.status.name }}</b>
          <br>{{ match.reason.name }}
        <td class="">
          {{ entity_macros.release_summary(match.release) }}
        <td class="">
          {% if match.access_options %}
            <a href="{{ match.access_options[0].access_url}}" class="ui tiny green active button">{{ match.access_options[0].access_type.name }}</a>
          {% else %}
            <i class="ui tiny grey inactive button">no fulltext</a>
          {% endif %}
  {% endfor %}
  </tbody>
  </table>

{% endif %}

{% endblock %}