prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Put `Review suggestions` action button before others
  Let's change order of action buttons and put `Review suggestions` before `Needs translation` to encourage going through suggestion backlog.
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `pootle/core/browser.py`
  Content:
  ```
  1 #!/usr/bin/env python
  2 # -*- coding: utf-8 -*-
  3 #
  4 # Copyright (C) Pootle contributors.
  5 #
  6 # This file is a part of the Pootle project. It is distributed under the GPL3
  7 # or later license. See the LICENSE file for a copy of the license and the
  8 # AUTHORS file for copyright and authorship information.
  9 
  10 from django.utils.translation import ugettext_lazy as _
  11 
  12 
  13 HEADING_CHOICES = [
  14     {
  15         'id': 'name',
  16         'class': 'stats',
  17         'display_name': _("Name"),
  18     },
  19     {
  20         'id': 'priority',
  21         'class': 'stats-number sorttable_numeric',
  22         'display_name': _("Priority"),
  23     },
  24     {
  25         'id': 'project',
  26         'class': 'stats',
  27         'display_name': _("Project"),
  28     },
  29     {
  30         'id': 'language',
  31         'class': 'stats',
  32         'display_name': _("Language"),
  33     },
  34     {
  35         'id': 'progress',
  36         'class': 'stats',
  37         # Translators: noun. The graphical representation of translation status
  38         'display_name': _("Progress"),
  39     },
  40     {
  41         'id': 'total',
  42         'class': 'stats-number sorttable_numeric when-loaded',
  43         # Translators: Heading representing the total number of words of a file
  44         # or directory
  45         'display_name': _("Total"),
  46     },
  47     {
  48         'id': 'last-updated',
  49         'class': 'stats sorttable_numeric when-loaded',
  50         'display_name': _("Last updated"),
  51     },
  52     {
  53         'id': 'need-translation',
  54         'class': 'stats-number sorttable_numeric when-loaded',
  55         'display_name': _("Need Translation"),
  56     },
  57     {
  58         'id': 'suggestions',
  59         'class': 'stats-number sorttable_numeric when-loaded',
  60         # Translators: The number of suggestions pending review
  61         'display_name': _("Suggestions"),
  62     },
  63     {
  64         'id': 'critical',
  65         'class': 'stats-number sorttable_numeric when-loaded',
  66         'display_name': _("Critical"),
  67     },
  68     {
  69         'id': 'activity',
  70         'class': 'stats sorttable_numeric when-loaded',
  71         'display_name': _("Last Activity"),
  72     },
  73 ]
  74 
  75 
  76 def get_table_headings(choices):
  77     """Filters the list of available table headings to the given `choices`."""
  78     return filter(lambda x: x['id'] in choices, HEADING_CHOICES)
  79 
  80 
  81 def make_generic_item(path_obj, **kwargs):
  82     """Template variables for each row in the table."""
  83     return {
  84         'href': path_obj.get_absolute_url(),
  85         'href_all': path_obj.get_translate_url(),
  86         'href_todo': path_obj.get_translate_url(state='incomplete', **kwargs),
  87         'href_sugg': path_obj.get_translate_url(state='suggestions', **kwargs),
  88         'href_critical': path_obj.get_critical_url(**kwargs),
  89         'title': path_obj.name,
  90         'code': path_obj.code,
  91         'is_disabled': getattr(path_obj, 'disabled', False),
  92     }
  93 
  94 
  95 def make_directory_item(directory, **filters):
  96     item = make_generic_item(directory, **filters)
  97     item.update({
  98         'icon': 'folder',
  99     })
  100     return item
  101 
  102 
  103 def make_store_item(store):
  104     item = make_generic_item(store)
  105     item.update({
  106         'icon': 'file',
  107     })
  108     return item
  109 
  110 
  111 def get_parent(path_obj):
  112     """Retrieves a representation of the parent object.
  113 
  114     :param path_obj: either a `Directory` or Store` instance.
  115     """
  116     parent_dir = path_obj.parent
  117 
  118     if parent_dir.is_project():
  119         return None
  120 
  121     if parent_dir.is_language():
  122         label = _('Back to language')
  123     else:
  124         label = _('Back to parent folder')
  125 
  126     return {
  127         'title': label,
  128         'href': parent_dir.get_absolute_url()
  129     }
  130 
  131 
  132 def make_project_item(translation_project):
  133     item = make_generic_item(translation_project)
  134     item.update({
  135         'icon': 'project',
  136         'title': translation_project.project.name,
  137     })
  138     return item
  139 
  140 
  141 def make_language_item(translation_project):
  142     item = make_generic_item(translation_project)
  143     item.update({
  144         'icon': 'language',
  145         'title': translation_project.language.name,
  146     })
  147     return item
  148 
  149 
  150 def make_xlanguage_item(resource_obj):
  151     translation_project = resource_obj.translation_project
  152     item = make_generic_item(resource_obj)
  153     item.update({
  154         'icon': 'language',
  155         'code': translation_project.language.code,
  156         'title': translation_project.language.name,
  157     })
  158     return item
  159 
  160 
  161 def make_project_list_item(project):
  162     item = make_generic_item(project)
  163     item.update({
  164         'icon': 'project',
  165         'title': project.fullname,
  166     })
  167     return item
  168
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/pootle/core/browser.py b/pootle/core/browser.py
  --- a/pootle/core/browser.py
  +++ b/pootle/core/browser.py
  @@ -50,9 +50,9 @@
           'display_name': _("Last updated"),
       },
       {
  -        'id': 'need-translation',
  +        'id': 'critical',
           'class': 'stats-number sorttable_numeric when-loaded',
  -        'display_name': _("Need Translation"),
  +        'display_name': _("Critical"),
       },
       {
           'id': 'suggestions',
  @@ -61,9 +61,9 @@
           'display_name': _("Suggestions"),
       },
       {
  -        'id': 'critical',
  +        'id': 'need-translation',
           'class': 'stats-number sorttable_numeric when-loaded',
  -        'display_name': _("Critical"),
  +        'display_name': _("Need Translation"),
       },
       {
           'id': 'activity',
  
verification_info: {"golden_diff": "diff --git a/pootle/core/browser.py b/pootle/core/browser.py\n--- a/pootle/core/browser.py\n+++ b/pootle/core/browser.py\n@@ -50,9 +50,9 @@\n         'display_name': _(\"Last updated\"),\n     },\n     {\n-        'id': 'need-translation',\n+        'id': 'critical',\n         'class': 'stats-number sorttable_numeric when-loaded',\n-        'display_name': _(\"Need Translation\"),\n+        'display_name': _(\"Critical\"),\n     },\n     {\n         'id': 'suggestions',\n@@ -61,9 +61,9 @@\n         'display_name': _(\"Suggestions\"),\n     },\n     {\n-        'id': 'critical',\n+        'id': 'need-translation',\n         'class': 'stats-number sorttable_numeric when-loaded',\n-        'display_name': _(\"Critical\"),\n+        'display_name': _(\"Need Translation\"),\n     },\n     {\n         'id': 'activity',\n", "issue": "Put `Review suggestions` action button before others\nLet's change order of action buttons and put `Review suggestions` before `Needs translation` to encourage going through suggestion backlog.\n\n", "before_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) Pootle contributors.\n#\n# This file is a part of the Pootle project. It is distributed under the GPL3\n# or later license. See the LICENSE file for a copy of the license and the\n# AUTHORS file for copyright and authorship information.\n\nfrom django.utils.translation import ugettext_lazy as _\n\n\nHEADING_CHOICES = [\n    {\n        'id': 'name',\n        'class': 'stats',\n        'display_name': _(\"Name\"),\n    },\n    {\n        'id': 'priority',\n        'class': 'stats-number sorttable_numeric',\n        'display_name': _(\"Priority\"),\n    },\n    {\n        'id': 'project',\n        'class': 'stats',\n        'display_name': _(\"Project\"),\n    },\n    {\n        'id': 'language',\n        'class': 'stats',\n        'display_name': _(\"Language\"),\n    },\n    {\n        'id': 'progress',\n        'class': 'stats',\n        # Translators: noun. The graphical representation of translation status\n        'display_name': _(\"Progress\"),\n    },\n    {\n        'id': 'total',\n        'class': 'stats-number sorttable_numeric when-loaded',\n        # Translators: Heading representing the total number of words of a file\n        # or directory\n        'display_name': _(\"Total\"),\n    },\n    {\n        'id': 'last-updated',\n        'class': 'stats sorttable_numeric when-loaded',\n        'display_name': _(\"Last updated\"),\n    },\n    {\n        'id': 'need-translation',\n        'class': 'stats-number sorttable_numeric when-loaded',\n        'display_name': _(\"Need Translation\"),\n    },\n    {\n        'id': 'suggestions',\n        'class': 'stats-number sorttable_numeric when-loaded',\n        # Translators: The number of suggestions pending review\n        'display_name': _(\"Suggestions\"),\n    },\n    {\n        'id': 'critical',\n        'class': 'stats-number sorttable_numeric when-loaded',\n        'display_name': _(\"Critical\"),\n    },\n    {\n        'id': 'activity',\n        'class': 'stats sorttable_numeric when-loaded',\n        'display_name': _(\"Last Activity\"),\n    },\n]\n\n\ndef get_table_headings(choices):\n    \"\"\"Filters the list of available table headings to the given `choices`.\"\"\"\n    return filter(lambda x: x['id'] in choices, HEADING_CHOICES)\n\n\ndef make_generic_item(path_obj, **kwargs):\n    \"\"\"Template variables for each row in the table.\"\"\"\n    return {\n        'href': path_obj.get_absolute_url(),\n        'href_all': path_obj.get_translate_url(),\n        'href_todo': path_obj.get_translate_url(state='incomplete', **kwargs),\n        'href_sugg': path_obj.get_translate_url(state='suggestions', **kwargs),\n        'href_critical': path_obj.get_critical_url(**kwargs),\n        'title': path_obj.name,\n        'code': path_obj.code,\n        'is_disabled': getattr(path_obj, 'disabled', False),\n    }\n\n\ndef make_directory_item(directory, **filters):\n    item = make_generic_item(directory, **filters)\n    item.update({\n        'icon': 'folder',\n    })\n    return item\n\n\ndef make_store_item(store):\n    item = make_generic_item(store)\n    item.update({\n        'icon': 'file',\n    })\n    return item\n\n\ndef get_parent(path_obj):\n    \"\"\"Retrieves a representation of the parent object.\n\n    :param path_obj: either a `Directory` or Store` instance.\n    \"\"\"\n    parent_dir = path_obj.parent\n\n    if parent_dir.is_project():\n        return None\n\n    if parent_dir.is_language():\n        label = _('Back to language')\n    else:\n        label = _('Back to parent folder')\n\n    return {\n        'title': label,\n        'href': parent_dir.get_absolute_url()\n    }\n\n\ndef make_project_item(translation_project):\n    item = make_generic_item(translation_project)\n    item.update({\n        'icon': 'project',\n        'title': translation_project.project.name,\n    })\n    return item\n\n\ndef make_language_item(translation_project):\n    item = make_generic_item(translation_project)\n    item.update({\n        'icon': 'language',\n        'title': translation_project.language.name,\n    })\n    return item\n\n\ndef make_xlanguage_item(resource_obj):\n    translation_project = resource_obj.translation_project\n    item = make_generic_item(resource_obj)\n    item.update({\n        'icon': 'language',\n        'code': translation_project.language.code,\n        'title': translation_project.language.name,\n    })\n    return item\n\n\ndef make_project_list_item(project):\n    item = make_generic_item(project)\n    item.update({\n        'icon': 'project',\n        'title': project.fullname,\n    })\n    return item\n", "path": "pootle/core/browser.py"}], "after_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) Pootle contributors.\n#\n# This file is a part of the Pootle project. It is distributed under the GPL3\n# or later license. See the LICENSE file for a copy of the license and the\n# AUTHORS file for copyright and authorship information.\n\nfrom django.utils.translation import ugettext_lazy as _\n\n\nHEADING_CHOICES = [\n    {\n        'id': 'name',\n        'class': 'stats',\n        'display_name': _(\"Name\"),\n    },\n    {\n        'id': 'priority',\n        'class': 'stats-number sorttable_numeric',\n        'display_name': _(\"Priority\"),\n    },\n    {\n        'id': 'project',\n        'class': 'stats',\n        'display_name': _(\"Project\"),\n    },\n    {\n        'id': 'language',\n        'class': 'stats',\n        'display_name': _(\"Language\"),\n    },\n    {\n        'id': 'progress',\n        'class': 'stats',\n        # Translators: noun. The graphical representation of translation status\n        'display_name': _(\"Progress\"),\n    },\n    {\n        'id': 'total',\n        'class': 'stats-number sorttable_numeric when-loaded',\n        # Translators: Heading representing the total number of words of a file\n        # or directory\n        'display_name': _(\"Total\"),\n    },\n    {\n        'id': 'last-updated',\n        'class': 'stats sorttable_numeric when-loaded',\n        'display_name': _(\"Last updated\"),\n    },\n    {\n        'id': 'critical',\n        'class': 'stats-number sorttable_numeric when-loaded',\n        'display_name': _(\"Critical\"),\n    },\n    {\n        'id': 'suggestions',\n        'class': 'stats-number sorttable_numeric when-loaded',\n        # Translators: The number of suggestions pending review\n        'display_name': _(\"Suggestions\"),\n    },\n    {\n        'id': 'need-translation',\n        'class': 'stats-number sorttable_numeric when-loaded',\n        'display_name': _(\"Need Translation\"),\n    },\n    {\n        'id': 'activity',\n        'class': 'stats sorttable_numeric when-loaded',\n        'display_name': _(\"Last Activity\"),\n    },\n]\n\n\ndef get_table_headings(choices):\n    \"\"\"Filters the list of available table headings to the given `choices`.\"\"\"\n    return filter(lambda x: x['id'] in choices, HEADING_CHOICES)\n\n\ndef make_generic_item(path_obj, **kwargs):\n    \"\"\"Template variables for each row in the table.\"\"\"\n    return {\n        'href': path_obj.get_absolute_url(),\n        'href_all': path_obj.get_translate_url(),\n        'href_todo': path_obj.get_translate_url(state='incomplete', **kwargs),\n        'href_sugg': path_obj.get_translate_url(state='suggestions', **kwargs),\n        'href_critical': path_obj.get_critical_url(**kwargs),\n        'title': path_obj.name,\n        'code': path_obj.code,\n        'is_disabled': getattr(path_obj, 'disabled', False),\n    }\n\n\ndef make_directory_item(directory, **filters):\n    item = make_generic_item(directory, **filters)\n    item.update({\n        'icon': 'folder',\n    })\n    return item\n\n\ndef make_store_item(store):\n    item = make_generic_item(store)\n    item.update({\n        'icon': 'file',\n    })\n    return item\n\n\ndef get_parent(path_obj):\n    \"\"\"Retrieves a representation of the parent object.\n\n    :param path_obj: either a `Directory` or Store` instance.\n    \"\"\"\n    parent_dir = path_obj.parent\n\n    if parent_dir.is_project():\n        return None\n\n    if parent_dir.is_language():\n        label = _('Back to language')\n    else:\n        label = _('Back to parent folder')\n\n    return {\n        'title': label,\n        'href': parent_dir.get_absolute_url()\n    }\n\n\ndef make_project_item(translation_project):\n    item = make_generic_item(translation_project)\n    item.update({\n        'icon': 'project',\n        'title': translation_project.project.name,\n    })\n    return item\n\n\ndef make_language_item(translation_project):\n    item = make_generic_item(translation_project)\n    item.update({\n        'icon': 'language',\n        'title': translation_project.language.name,\n    })\n    return item\n\n\ndef make_xlanguage_item(resource_obj):\n    translation_project = resource_obj.translation_project\n    item = make_generic_item(resource_obj)\n    item.update({\n        'icon': 'language',\n        'code': translation_project.language.code,\n        'title': translation_project.language.name,\n    })\n    return item\n\n\ndef make_project_list_item(project):\n    item = make_generic_item(project)\n    item.update({\n        'icon': 'project',\n        'title': project.fullname,\n    })\n    return item\n", "path": "pootle/core/browser.py"}]}