prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Missing search template
  <!-- Do you want to ask a question? Are you looking for support? The system administrator can help you: admin@utn.se -->
  
  ### Prerequisites
  
  * [X] Put an X between the brackets on this line if you have done all of the
  following:
      * Reproduced the problem with clear cache.
      * (If running the application locally:) Made sure your running the newest version on the development branch
      * Checked that your issue isn't already filed: https://github.com/UTNkar/moore/issues
  
  ### Description
  
  The current search is now really working. Although you can search, the results are ugly and very spotty. 
  
  Goal: Evaluate the searchable fields within Project Moore and make a search template.
  
  ### Steps to Reproduce
  
  1. Visit the home page
  2. Search something
  3. Be disappointed ☹️ 
  
  <!-- Please select the appropriate "topic category"/blue and "issue type"/yellow label -->
  
  </issue>
  <code>
  [start of website/materialize/templatetags/materialize.py]
  1 from django import template
  2 from django.template import loader
  3 
  4 register = template.Library()
  5 
  6 
  7 def get_widget_name(field):
  8     return field.field.widget.__class__.__name__
  9 
  10 
  11 def append_classes(field):
  12     field.field.label_suffix = ''
  13     classes = field.field.widget.attrs.get('class', '')
  14     classes += ' validate'
  15     if field.errors:
  16         classes += ' invalid'
  17     field.field.widget.attrs['class'] = classes
  18 
  19 
  20 def render_field(template, field, prefix=None):
  21     t = loader.get_template(template)
  22     c = {
  23         'field': field,
  24         'prefix': prefix,
  25     }
  26     html = t.render(c)
  27     return html
  28 
  29 
  30 @register.simple_tag
  31 def materialize_field(field, prefix=None):
  32     widget = get_widget_name(field)
  33     if widget in ['TextInput', 'EmailInput', 'PasswordInput', 'Select',
  34                   'Textarea']:
  35         append_classes(field)
  36         return render_field('materialize/form/input.html', field, prefix)
  37     else:
  38         return field.as_widget()
  39
  [end of website/materialize/templatetags/materialize.py]
  [start of website/search/views.py]
  1 from __future__ import absolute_import, unicode_literals
  2 
  3 from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
  4 from django.shortcuts import render
  5 
  6 from wagtail.wagtailcore.models import Page
  7 from wagtail.wagtailsearch.models import Query
  8 
  9 
  10 def search(request):
  11     search_query = request.GET.get('query', None)
  12     page = request.GET.get('page', 1)
  13 
  14     # Search
  15     if search_query:
  16         search_results = Page.objects.live().search(search_query)
  17         query = Query.get(search_query)
  18 
  19         # Record hit
  20         query.add_hit()
  21     else:
  22         search_results = Page.objects.none()
  23 
  24     # Pagination
  25     paginator = Paginator(search_results, 10)
  26     try:
  27         search_results = paginator.page(page)
  28     except PageNotAnInteger:
  29         search_results = paginator.page(1)
  30     except EmptyPage:
  31         search_results = paginator.page(paginator.num_pages)
  32 
  33     return render(request, 'search/search.html', {
  34         'search_query': search_query,
  35         'search_results': search_results,
  36     })
  37
  [end of website/search/views.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/website/materialize/templatetags/materialize.py b/website/materialize/templatetags/materialize.py
  --- a/website/materialize/templatetags/materialize.py
  +++ b/website/materialize/templatetags/materialize.py
  @@ -23,8 +23,7 @@
           'field': field,
           'prefix': prefix,
       }
  -    html = t.render(c)
  -    return html
  +    return t.render(c)
   
   
   @register.simple_tag
  @@ -36,3 +35,12 @@
           return render_field('materialize/form/input.html', field, prefix)
       else:
           return field.as_widget()
  +
  +
  +@register.inclusion_tag('materialize/pagination.html')
  +def materialize_pagination(page, url):
  +    return {
  +        'page': page,
  +        'paginator': page.paginator,
  +        'url': url,
  +    }
  diff --git a/website/search/views.py b/website/search/views.py
  --- a/website/search/views.py
  +++ b/website/search/views.py
  @@ -22,7 +22,7 @@
           search_results = Page.objects.none()
   
       # Pagination
  -    paginator = Paginator(search_results, 10)
  +    paginator = Paginator(search_results, 25)
       try:
           search_results = paginator.page(page)
       except PageNotAnInteger:
  
verification_info: {"golden_diff": "diff --git a/website/materialize/templatetags/materialize.py b/website/materialize/templatetags/materialize.py\n--- a/website/materialize/templatetags/materialize.py\n+++ b/website/materialize/templatetags/materialize.py\n@@ -23,8 +23,7 @@\n         'field': field,\n         'prefix': prefix,\n     }\n-    html = t.render(c)\n-    return html\n+    return t.render(c)\n \n \n @register.simple_tag\n@@ -36,3 +35,12 @@\n         return render_field('materialize/form/input.html', field, prefix)\n     else:\n         return field.as_widget()\n+\n+\n+@register.inclusion_tag('materialize/pagination.html')\n+def materialize_pagination(page, url):\n+    return {\n+        'page': page,\n+        'paginator': page.paginator,\n+        'url': url,\n+    }\ndiff --git a/website/search/views.py b/website/search/views.py\n--- a/website/search/views.py\n+++ b/website/search/views.py\n@@ -22,7 +22,7 @@\n         search_results = Page.objects.none()\n \n     # Pagination\n-    paginator = Paginator(search_results, 10)\n+    paginator = Paginator(search_results, 25)\n     try:\n         search_results = paginator.page(page)\n     except PageNotAnInteger:\n", "issue": "Missing search template\n<!-- Do you want to ask a question? Are you looking for support? The system administrator can help you: admin@utn.se -->\r\n\r\n### Prerequisites\r\n\r\n* [X] Put an X between the brackets on this line if you have done all of the\r\nfollowing:\r\n    * Reproduced the problem with clear cache.\r\n    * (If running the application locally:) Made sure your running the newest version on the development branch\r\n    * Checked that your issue isn't already filed: https://github.com/UTNkar/moore/issues\r\n\r\n### Description\r\n\r\nThe current search is now really working. Although you can search, the results are ugly and very spotty. \r\n\r\nGoal: Evaluate the searchable fields within Project Moore and make a search template.\r\n\r\n### Steps to Reproduce\r\n\r\n1. Visit the home page\r\n2. Search something\r\n3. Be disappointed \u2639\ufe0f \r\n\r\n<!-- Please select the appropriate \"topic category\"/blue and \"issue type\"/yellow label -->\n", "before_files": [{"content": "from django import template\nfrom django.template import loader\n\nregister = template.Library()\n\n\ndef get_widget_name(field):\n    return field.field.widget.__class__.__name__\n\n\ndef append_classes(field):\n    field.field.label_suffix = ''\n    classes = field.field.widget.attrs.get('class', '')\n    classes += ' validate'\n    if field.errors:\n        classes += ' invalid'\n    field.field.widget.attrs['class'] = classes\n\n\ndef render_field(template, field, prefix=None):\n    t = loader.get_template(template)\n    c = {\n        'field': field,\n        'prefix': prefix,\n    }\n    html = t.render(c)\n    return html\n\n\n@register.simple_tag\ndef materialize_field(field, prefix=None):\n    widget = get_widget_name(field)\n    if widget in ['TextInput', 'EmailInput', 'PasswordInput', 'Select',\n                  'Textarea']:\n        append_classes(field)\n        return render_field('materialize/form/input.html', field, prefix)\n    else:\n        return field.as_widget()\n", "path": "website/materialize/templatetags/materialize.py"}, {"content": "from __future__ import absolute_import, unicode_literals\n\nfrom django.core.paginator import EmptyPage, PageNotAnInteger, Paginator\nfrom django.shortcuts import render\n\nfrom wagtail.wagtailcore.models import Page\nfrom wagtail.wagtailsearch.models import Query\n\n\ndef search(request):\n    search_query = request.GET.get('query', None)\n    page = request.GET.get('page', 1)\n\n    # Search\n    if search_query:\n        search_results = Page.objects.live().search(search_query)\n        query = Query.get(search_query)\n\n        # Record hit\n        query.add_hit()\n    else:\n        search_results = Page.objects.none()\n\n    # Pagination\n    paginator = Paginator(search_results, 10)\n    try:\n        search_results = paginator.page(page)\n    except PageNotAnInteger:\n        search_results = paginator.page(1)\n    except EmptyPage:\n        search_results = paginator.page(paginator.num_pages)\n\n    return render(request, 'search/search.html', {\n        'search_query': search_query,\n        'search_results': search_results,\n    })\n", "path": "website/search/views.py"}]}