A search interface for the Performing Patents Otherwise publication as part of the Politics of Patents case study (part of Copim WP6): this parses data from the archive of RTF files and provides additional data from the European Patent Office OPS API. https://patents.copim.ac.uk
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
2.2KB

  1. {% extends "base.html" %}
  2. {% block content %}
  3. <div class="row p-3">
  4. <form action="{{ url_for('search.basic_search') }}" method="POST">
  5. <input type="hidden" name="search" value="{{ search }}">
  6. <input type="hidden" name="searchopt" value="{{ core }}">
  7. sort by:
  8. <select name="sort" id="sort" onchange="this.form.submit()">
  9. <option value="relevance" {% if sort == 'relevance' %} selected {% endif %}>relevance</option>
  10. <option value="year desc" {% if sort == 'year desc' %} selected {% endif %}>year descending</option>
  11. <option value="year asc" {% if sort == 'year asc' %} selected {% endif %}>year ascending</option>
  12. </select>
  13. <noscript>
  14. <input type="submit" class="btn btn-default" value="Set" />
  15. </noscript>
  16. </form>
  17. </div>
  18. {% if results == 'no results found' %}
  19. {{ results }}
  20. {% else %}
  21. {% for result in results %}
  22. Application ID:
  23. <a href="{{ url_for('search.id_search', id=result['id'], core='all') }}">
  24. <span class="result-entry">
  25. {{ result['application_id'] }}
  26. </span>
  27. </a>
  28. <br><br>
  29. Year:
  30. {{ result['year'] }}
  31. <br><br>
  32. EPO publication:
  33. <a href="{{ result['epo_publication_url'] }}">
  34. {{ result['epo_publication_url'] }}
  35. </a>
  36. <br><br>
  37. IPC publication:
  38. <a href="{{ result['ipc_publication_url'] }}">
  39. {{ result['ipc_publication_url'] }}
  40. </a>
  41. <br><br>
  42. {% if result['title'] is defined %}
  43. Title:
  44. <span class="result-entry">
  45. {{ result['title'] }}
  46. </span>
  47. <br><br>
  48. {% endif %}
  49. {% if result['abstract'] is defined %}
  50. Abstract:
  51. <span class="result-entry">
  52. {{ result['abstract'] }}
  53. </span>
  54. <br><br>
  55. {% endif %}
  56. <hr>
  57. {% endfor %}
  58. {% endif %}
  59. <script>
  60. let search_string = "{{ search }}";
  61. const search_array = search_string.split(" ");
  62. for (const term of search_array){
  63. $("span[class=result-entry]:contains('" + term + "')").html(function(_, html) {
  64. var replace = "(" + term + ")";
  65. var re = new RegExp(replace, "g");
  66. return html.replace(re, '<span style="color:orange">$1</span>');
  67. });
  68. }
  69. </script>
  70. {% endblock %}