src/templates/build-filter.html \
src/templates/build-list.html \
src/templates/build-manage.html \
- src/templates/build-priority.html \
src/templates/build-schedule-test.html \
src/templates/build-state.html \
src/templates/builds-watchers-add.html \
+++ /dev/null
-{% extends "base.html" %}
-
-{% block title %}{{ _("Edit build priority") }}{% end block %}
-
-{% block body %}
- <h1>{{ _("Edit build priority") }}: {{ build.name }}</h1>
- <form method="post" action="">
- {% raw xsrf_form_html() %}
- <table class="form form3">
- <tr>
- <td class="col1">{{ _("Priority") }}</td>
- <td class="col2">
- <select name="priority">
- <option value="2" {% if build.priority >= 2 %}selected="selected"{% end %}>{{ _("Very high") }}</option>
- <option value="1" {% if build.priority == 1 %}selected="selected"{% end %}>{{ _("High") }}</option>
- <option value="0" {% if build.priority == 0 %}selected="selected"{% end %}>{{ _("Medium") }}</option>
- <option value="-1" {% if build.priority == -1 %}selected="selected"{% end %}>{{ _("Low") }}</option>
- <option value="-2" {% if build.priority <= -2 %}selected="selected"{% end %}>{{ _("Very low") }}</option>
- </select>
- </td>
- <td class="col3">
- {{ _("Set the priority of the build process.") }}
- </td>
- </tr>
- <tr>
- <td colspan="3">
- <p>
- <strong>{{ _("Beware") }}:</strong>
- {{ _("Shuffeling build jobs can cause problems with the dependency solving.") }}
- {{ _("Don't do this if you are not totally sure you won't break anything.") }}
- </p>
- </td>
- </tr>
- <tr>
- <td colspan="3" class="buttons">
- <input type="submit" value="{{ _("Save") }}" />
- </td>
- </tr>
- </table>
- </form>
-{% end block %}
(r"/build/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/bugs", builds.BuildBugsHandler),
(r"/build/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/manage", builds.BuildManageHandler),
(r"/build/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/comment", builds.BuildDetailCommentHandler),
- (r"/build/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/priority", builds.BuildPriorityHandler),
(r"/build/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/state", builds.BuildStateHandler),
(r"/build/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/watch", builds.BuildWatchersAddHandler),
(r"/build/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/watchers", builds.BuildWatchersHandler),
self.redirect("/build/%s" % build.uuid)
-class BuildPriorityHandler(base.BaseHandler):
- @tornado.web.authenticated
- def get(self, uuid):
- build = self.backend.builds.get_by_uuid(uuid)
-
- if not build:
- raise tornado.web.HTTPError(404, "Build not found")
-
- self.render("build-priority.html", build=build)
-
- @tornado.web.authenticated
- def post(self, uuid):
- build = self.backend.builds.get_by_uuid(uuid)
-
- if not build:
- raise tornado.web.HTTPError(404, "Build not found")
-
- # Get the priority from the request data and convert it to an integer.
- # If that cannot be done, we default to zero.
- prio = self.get_argument("priority")
- try:
- prio = int(prio)
- except TypeError:
- prio = 0
-
- # Check if the value is in a valid range.
- if not prio in (-2, -1, 0, 1, 2):
- prio = 0
-
- # Save priority.
- build.priority = prio
-
- self.redirect("/build/%s" % build.uuid)
-
-
class BuildWatchersHandler(base.BaseHandler):
def get(self, uuid):
build = self.backend.builds.get_by_uuid(uuid)