diff --git a/src/Controller/SnipController.php b/src/Controller/SnipController.php
index e47c7e2..434c8c9 100644
--- a/src/Controller/SnipController.php
+++ b/src/Controller/SnipController.php
@@ -167,6 +167,6 @@ class SnipController extends AbstractController
$this->addFlash('success', sprintf('Snip "%s" unarchived', $snip));
}
- return $this->redirectToRoute('snip_single', ['snip' => $snip->getId()]);
+ return $this->redirectToRoute('snip_edit', ['snip' => $snip->getId()]);
}
}
\ No newline at end of file
diff --git a/templates/snip/base.html.twig b/templates/snip/base.html.twig
new file mode 100644
index 0000000..4b21a19
--- /dev/null
+++ b/templates/snip/base.html.twig
@@ -0,0 +1,74 @@
+{% extends 'base/one.column.html.twig' %}
+
+{% block body %}
+ {% if app.user and app.user is same as(snip.createdBy) %}
+
+ Index
+
+ {% else %}
+
+ Index
+
+ {% endif %}
+ {% block buttons %}{% endblock %}
+
+
+
+
+
+ {% block cardbody %}{% endblock %}
+
+
+
+{% endblock %}
+
+{% block css %}
+ {{ parent() }}
+
+{% endblock %}
+
+{% block js %}
+ {{ parent() }}
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/templates/snip/edit.html.twig b/templates/snip/edit.html.twig
index 6bc44bd..0695aae 100644
--- a/templates/snip/edit.html.twig
+++ b/templates/snip/edit.html.twig
@@ -1,21 +1,27 @@
-{% extends 'base/one.column.html.twig' %}
+{% extends 'snip/base.html.twig' %}
{% if snip.id %}
- {% set title = 'Edit Snip ' ~ snip %}
+ {% set title %}{{ snip }} - Edit{% endset %}
{% else %}
{% set title = 'Create Snip' %}
{% endif %}
+{% set active = 'edit' %}
-{% block body %}
- {% if snip.id %}
-
-
- Back
+{% block buttons %}
+ {% if is_granted('edit', snip) %}
+
+ {% if snip.archived %}
+ Unarchive
+ {% else %}
+ Archive
+ {% endif %}
+
+
+ Delete
{% endif %}
-
-
- Index
-
+{% endblock %}
+
+{% block cardbody %}
{{ form(form) }}
{% endblock %}
\ No newline at end of file
diff --git a/templates/snip/single.html.twig b/templates/snip/single.html.twig
index bd3a7dd..c9814cc 100644
--- a/templates/snip/single.html.twig
+++ b/templates/snip/single.html.twig
@@ -1,63 +1,16 @@
-{% extends 'base/one.column.html.twig' %}
+{% extends 'snip/base.html.twig' %}
-{% set title %}Snip {{ snip }}{% endset %}
+{% set title %}{{ snip }} - View{% endset %}
+{% set active = 'single' %}
-{% block body %}
- {% if app.user %}
-
- Back
-
- {% else %}
-
- Index
-
- {% endif %}
- {% if is_granted('edit', snip) %}
-
- Versions
-
-
- Edit
-
-
- {% if snip.archived %}
- Unarchive
- {% else %}
- Archive
- {% endif %}
-
-
- Delete
-
- {% endif %}
-
+{% block buttons %}
+
Raw
-
-
-
-
- {{ content|raw }}
-
-
-
+{% endblock %}
+
+{% block cardbody %}
+ {{ content|raw }}
{% endblock %}
{% block css %}
diff --git a/templates/user/badge.html.twig b/templates/user/badge.html.twig
index a6c3cd5..1e014f6 100644
--- a/templates/user/badge.html.twig
+++ b/templates/user/badge.html.twig
@@ -1 +1,3 @@
-{{ user }}
\ No newline at end of file
+
+ {{ user }}
+
\ No newline at end of file
diff --git a/templates/version/index.html.twig b/templates/version/index.html.twig
index 81a7c20..079d141 100644
--- a/templates/version/index.html.twig
+++ b/templates/version/index.html.twig
@@ -1,18 +1,18 @@
-{% extends 'base/one.column.html.twig' %}
+{% extends 'snip/base.html.twig' %}
-{% set title = 'Snip ' ~ snip %}
+{% set title %}{{ snip }} - Versions{% endset %}
+{% set active = 'versions' %}
-{% block body %}
-
- Back
-
+{% block buttons %}
Latest
Compare
-
+{% endblock %}
+
+{% block cardbody %}
{% for version in snip.snipContents|reverse %}