Start with snips content abstraction
This commit is contained in:
@ -25,7 +25,7 @@ class HistoryController extends AbstractController
|
||||
|
||||
return $this->render('history/index.html.twig', [
|
||||
'snip' => $snip,
|
||||
'commits' => $this->snipServiceFactory->create($snip)->getRepo()->getAllCommits(),
|
||||
'commits' => $this->snipServiceFactory->create($snip)->getHistory(),
|
||||
]);
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ class HistoryController extends AbstractController
|
||||
{
|
||||
$this->denyAccessUnlessGranted(SnipVoter::EDIT, $snip);
|
||||
|
||||
$this->snipServiceFactory->create($snip)->getRepo()->checkout($commit);
|
||||
$this->snipServiceFactory->create($snip)->setCommit($commit);
|
||||
$this->addFlash('success', 'Snip version set to ' . $commit);
|
||||
return $this->redirectToRoute('snip_single', ['snip' => $snip->getId()]);
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ class SnipController extends AbstractController
|
||||
return $this->render('snip/single.html.twig', [
|
||||
'snip' => $snip,
|
||||
'content' => (new Pipeline())->parse($snipService->get()),
|
||||
'branch' => $snipService->getRepo()->getCurrentBranchName(),
|
||||
'branch' => $snipService->getCommit(),
|
||||
]);
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ class SnipController extends AbstractController
|
||||
$form = $this->createForm(ConfirmationType::class);
|
||||
$form->handleRequest($request);
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$this->snipServiceFactory->create($snip)->deleteRepo();
|
||||
$this->snipServiceFactory->create($snip)->delete();
|
||||
$this->repository->remove($snip);
|
||||
$this->addFlash('success', sprintf('Snip "%s" deleted', $snip));
|
||||
return $this->redirectToRoute('snip_index');
|
||||
|
Reference in New Issue
Block a user