diff --git a/src/Service/SnipService.php b/src/Service/SnipService.php index f19f39f..9250d09 100644 --- a/src/Service/SnipService.php +++ b/src/Service/SnipService.php @@ -19,7 +19,6 @@ class SnipService { $git = new Git(); $repoPath = sprintf('%s/%s', $snipBasePath, $snip->getId()); - dump($repoPath, $snip); if (!is_dir($repoPath)) { $this->repo = $git->init($repoPath); } else { @@ -39,7 +38,6 @@ class SnipService public function update(string $snipContents): void { - dump($this->getSnipPath()); file_put_contents($this->getSnipPath(), $snipContents); $this->repo->addFile('snip.txt'); if ($this->repo->hasChanges()) { diff --git a/templates/security/register.html.twig b/templates/security/register.html.twig index 0036da8..002321e 100644 --- a/templates/security/register.html.twig +++ b/templates/security/register.html.twig @@ -1,5 +1,7 @@ {% extends 'base/base.html.twig' %} +{% block title %}Register{% endblock %} + {% block body %}

Register new user

{{ form(registrationForm) }} diff --git a/templates/snip/edit.html.twig b/templates/snip/edit.html.twig index b8990aa..690b0ff 100644 --- a/templates/snip/edit.html.twig +++ b/templates/snip/edit.html.twig @@ -1,6 +1,18 @@ {% extends 'base/base.html.twig' %} +{% block title %}Edit {{ snip }}{% endblock %} + {% block body %} + {% if snip.id %} + + + Back + + {% endif %} + + + Index +

Editing {{ snip }}

{{ form(form) }} {% endblock %} \ No newline at end of file diff --git a/templates/snip/index.html.twig b/templates/snip/index.html.twig index 0a6d7dd..297c9e2 100644 --- a/templates/snip/index.html.twig +++ b/templates/snip/index.html.twig @@ -1,8 +1,12 @@ {% extends 'base/base.html.twig' %} +{% block title %}My snippets{% endblock %} + {% block body %} -

Snippets

- Create a new Snip +

My snippets

+ + Add +

{% for snip in snips %} diff --git a/templates/snip/single.html.twig b/templates/snip/single.html.twig index be69858..b843e77 100644 --- a/templates/snip/single.html.twig +++ b/templates/snip/single.html.twig @@ -1,18 +1,27 @@ {% extends 'base/base.html.twig' %} +{% block title %}Snip {{ snip }}{% endblock %} + {% block body %} + + Back + + {% if is_granted('edit', snip) %} + + Edit + + {% endif %} + + Raw + +

- {% if is_granted('edit', snip) %} - - - - {% endif %} {{ include('snip/badge.html.twig', {snip: snip}) }} {{ snip }}

-

{{ content }}

+

{{ content|nl2br }}

{% endblock %} \ No newline at end of file