Added admin menu

Signed-off-by: Gergely Polonkai (W00d5t0ck) <polesz@w00d5t0ck.info>
This commit is contained in:
Gergely Polonkai (W00d5t0ck) 2012-09-05 15:54:26 +02:00
parent 7a254af1a9
commit a2f2fd7317
8 changed files with 51 additions and 13 deletions

View File

@ -152,4 +152,13 @@ class AdminController extends Controller
'chunk' => $chunk,
);
}
/**
* @Route("/")
* @Template
*/
public function indexAction()
{
return array();
}
}

View File

@ -0,0 +1,19 @@
/*
Document : admin.css
Created on : 2012.09.05., 15:49:05
Author : polonkai.gergely
Description:
Purpose of the stylesheet follows.
*/
ul.menu {
padding: .5em;
list-style-type: none;
margin: 0 0 1em 0;
border-bottom: 1px solid black;
}
ul.menu li {
display: inline;
margin-right: 1em;
}

View File

@ -1,6 +1,6 @@
{% extends 'GergelyPolonkaiFrontBundle:Default:front_base.html.twig' %}
{% extends 'GergelyPolonkaiFrontBundle:Admin:index.html.twig' %}
{% block content %}
{% block admincontent %}
{% if chunk.id is not null %}
<h3>Edit Code Chunk - {{ chunk.title }}</h3>
{% else %}
@ -11,4 +11,4 @@
<button type="submit">Save</button>
<a href="{{ path('GergelyPolonkaiFrontBundle_adminListChunk') }}">Cancel</a>
</form>
{% endblock content %}
{% endblock admincontent %}

View File

@ -0,0 +1,10 @@
{% extends 'GergelyPolonkaiFrontBundle:Default:front_base.html.twig' %}
{% block content %}
<ul class="menu">
<li><a href="{{ path('GergelyPolonkaiFrontBundle_adminListChunk') }}">Code Chunks</a></li>
<li><a href="{{ path('GergelyPolonkaiFrontBundle_adminBlogList') }}">Blog Posts</a></li>
</ul>
{% block admincontent %}
{% endblock %}
{% endblock content %}

View File

@ -1,6 +1,6 @@
{% extends 'GergelyPolonkaiFrontBundle:Default:front_base.html.twig' %}
{% extends 'GergelyPolonkaiFrontBundle:Admin:index.html.twig' %}
{% block content %}
{% block admincontent %}
<h3>All posts</h3>
<a href="{{ path('GergelyPolonkaiFrontBundle_adminEditBlogPost') }}">New post</a>
<table>
@ -24,4 +24,4 @@
{% endif %}
</table>
<a href="{{ path('GergelyPolonkaiFrontBundle_adminEditBlogPost') }}">New post</a>
{% endblock %}
{% endblock admincontent %}

View File

@ -1,6 +1,6 @@
{% extends 'GergelyPolonkaiFrontBundle:Default:front_base.html.twig' %}
{% extends 'GergelyPolonkaiFrontBundle:Admin:index.html.twig' %}
{% block content %}
{% block admincontent %}
<h3>Code chunks</h3>
<a href="{{ path('GergelyPolonkaiFrontBundle_adminEditChunk') }}">New Code Chunk</a>
{% if chunks %}
@ -24,4 +24,4 @@
</table>
{% endif %}
<a href="{{ path('GergelyPolonkaiFrontBundle_adminEditChunk') }}">New Code Chunk</a>
{% endblock content %}
{% endblock admincontent %}

View File

@ -10,4 +10,4 @@
<input type="password" name="_password" />
<button type="submit">Login</button>
</form>
{% endblock %}
{% endblock content %}

View File

@ -1,6 +1,6 @@
{% extends 'GergelyPolonkaiFrontBundle:Default:front_base.html.twig' %}
{% extends 'GergelyPolonkaiFrontBundle:Admin:index.html.twig' %}
{% block content %}
{% block admincontent %}
{% if post.id is not null %}
<form method="post" action="{{ path('GergelyPolonkaiFrontBundle_adminEditBlogPost', {id: post.id}) }}">
{% else %}
@ -10,4 +10,4 @@
<button type="submit">Save</button>
<a href="{{ path('GergelyPolonkaiFrontBundle_adminBlogList') }}">Cancel</a>
</form>
{% endblock content %}
{% endblock admincontent %}