|
- {% extends "base.html" %}
-
- {% block content %}
-
- <div class="row p-3">
- <form action="{{ url_for('search.basic_search') }}" method="POST">
- <input type="hidden" name="search" value="{{ search }}">
- <input type="hidden" name="searchopt" value="{{ core }}">
- sort by:
- <select name="sort" id="sort" onchange="this.form.submit()">
- <option value="relevance" {% if sort == 'relevance' %} selected {% endif %}>relevance</option>
- <option value="year desc" {% if sort == 'year desc' %} selected {% endif %}>year descending</option>
- <option value="year asc" {% if sort == 'year asc' %} selected {% endif %}>year ascending</option>
- </select>
- <noscript>
- <input type="submit" class="btn btn-default" value="Set" />
- </noscript>
- </form>
- </div>
-
- {% if results == 'no results found' %}
-
- {{ results }}
-
- {% else %}
-
- {% for result in results %}
-
- <p class="h1">
-
- Year:
-
- {{ result['year'] }}
-
- </p>
-
- {% if result['title'] is defined %}
- <p class="mb-2 mt-5">
- <span class="emphasis">Title:</span>
- <span class="result-entry">
- {{ result['title'] }}
- </span>
- </p>
- {% endif %}
-
- {% if result['abstract'] is defined %}
- <p class="mb-2">
- <span class="emphasis">Abstract:</span>
- <span class="result-entry">
- {{ result['abstract'] }}
- </span>
- </p>
- {% endif %}
-
- <div class="mt-2 mb-5 search-links">
- <p>
- <span class="emphasis">European Patent Office PDF:</span>
- <a href="{{ url_for('search.id_search', id=result['id'], core='all') }}">
- <span class="result-entry">
- {{ result['application_id'] }}
- </span>
- </a>
- </p>
- </div>
-
- {% endfor %}
-
- {% endif %}
-
- <script>
- let search_string = "{{ search }}";
- const search_array = search_string.split(" ");
- for (const term of search_array){
- $("span[class=result-entry]:contains('" + term + "')").html(function(_, html) {
- var replace = "(" + term + ")";
- var re = new RegExp(replace, "g");
- return html.replace(re, '<span style="color:orange">$1</span>');
- });
- }
- </script>
-
- {% endblock %}
|