Commits

Steve Losh committed c86eb84

Add a button to kick off a build from the project page.

Comments (0)

Files changed (2)

integration/views.py

 
 def run_build(request, slug):
     project = get_object_or_404(Project, slug=slug)
-    project.run_build()
+    
+    if 'run' in request.POST and request.POST['run'] == 'run':
+        project.run_build()
+    
     return HttpResponseRedirect(project.get_absolute_url())

templates/integration/project.html

 {% endblock header %}
 
 {% block content %}
+    <form method="post" action="{% url run_build slug=project.slug %}">
+        <p><input type="submit" value="Start a build" /></p>
+        <input type="hidden" name="run" value="run" />
+    </form>
     <h2>Builds</h2>
     {% for run in project.buildrun_set.all %}
         <p class="project-run {% if forloop.last %}last{% endif %}">