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.

search.html 2.1KB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. <p class="h1">
  23. Year:
  24. {{ result['year'] }}
  25. </p>
  26. {% if result['title'] is defined %}
  27. <p class="mb-2 mt-5">
  28. <span class="emphasis">Title:</span>
  29. <span class="result-entry">
  30. {{ result['title'] }}
  31. </span>
  32. </p>
  33. {% endif %}
  34. {% if result['abstract'] is defined %}
  35. <p class="mb-2">
  36. <span class="emphasis">Abstract:</span>
  37. <span class="result-entry">
  38. {{ result['abstract'] }}
  39. </span>
  40. </p>
  41. {% endif %}
  42. <div class="mt-2 mb-5 search-links">
  43. <p>
  44. <span class="emphasis">European Patent Office PDF:</span>
  45. <a href="{{ url_for('search.id_search', id=result['id'], core='all') }}">
  46. <span class="result-entry">
  47. {{ result['application_id'] }}
  48. </span>
  49. </a>
  50. </p>
  51. </div>
  52. {% endfor %}
  53. {% endif %}
  54. <script>
  55. let search_string = "{{ search }}";
  56. const search_array = search_string.split(" ");
  57. for (const term of search_array){
  58. $("span[class=result-entry]:contains('" + term + "')").html(function(_, html) {
  59. var replace = "(" + term + ")";
  60. var re = new RegExp(replace, "g");
  61. return html.replace(re, '<span style="color:orange">$1</span>');
  62. });
  63. }
  64. </script>
  65. {% endblock %}