mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +02:00
Started work on a build project tool.
This commit is contained in:
parent
fcd8d205d3
commit
3dc9376f40
5 changed files with 76 additions and 10 deletions
|
@ -71,6 +71,27 @@ class ProjectController extends AbstractController
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/{id}/build", name="project_build", requirements={"id"="\d+"})
|
||||
*/
|
||||
public function build(Project $project, Request $request, ProjectBuildHelper $buildHelper): Response
|
||||
{
|
||||
$this->denyAccessUnlessGranted('read', $project);
|
||||
|
||||
//If no number of builds is given (or it is invalid), just assume 1
|
||||
$number_of_builds = $request->query->getInt('n', 1);
|
||||
if ($number_of_builds < 1) {
|
||||
$number_of_builds = 1;
|
||||
}
|
||||
|
||||
|
||||
return $this->render('Projects/build/build.html.twig', [
|
||||
'buildHelper' => $buildHelper,
|
||||
'project' => $project,
|
||||
'number_of_builds' => $number_of_builds,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/add_parts", name="project_add_parts_no_id")
|
||||
* @Route("/{id}/add_parts", name="project_add_parts", requirements={"id"="\d+"})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue