Added group views

This commit is contained in:
Polonkai Gergely
2012-07-16 17:05:23 +02:00
parent 973b331825
commit 91b6f9f8b9
6 changed files with 108 additions and 0 deletions

View File

@@ -91,6 +91,51 @@ class DefaultController extends Controller
);
}
/**
* @Route("/csoport/{groupSlug}", name="KekRozsakFrontBundle_groupView")
* @Template()
*/
public function groupViewAction($groupSlug)
{
$groupRepo = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:Group');
if (!($group = $groupRepo->findOneBySlug($groupSlug)))
throw $this->createNotFoundException('A kért csoport nem létezik!');
return array(
'group' => $group,
);
}
/**
* @Route("/csoport/{groupSlug}/tagok", name="KekRozsakFrontBundle_groupMembers")
* @Template()
*/
public function groupMembersAction($groupSlug)
{
$groupRepo = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:Group');
if (!($group = $groupRepo->findOneBySlug($groupSlug)))
throw $this->createNotFoundException('A kért csoport nem létezik!');
return array(
'group' => $group,
);
}
/**
* @Route("/csoport/{groupSlug}/dokumentumok", name="KekRozsakFrontBundle_groupDocuments")
* @Template()
*/
public function groupDocumentsAction($groupSlug)
{
$groupRepo = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:Group');
if (!($group = $groupRepo->findOneBySlug($groupSlug)))
throw $this->createNotFoundException('A kért csoport nem létezik!');
return array(
'group' => $group,
);
}
/**
* @Route("/csoport/{groupSlug}/belepes", name="KekRozsakFrontBundle_groupJoin")
* @Template()

View File

@@ -0,0 +1,12 @@
{% extends '::main_template.html.twig' %}
{% block title %} - {{ group.name }}{% endblock %}
{% block additional_css %}
<link rel="stylesheet" href="{{ asset('css/group.css') }}" type="text/css" />
{% endblock additional_css %}
{% block content %}
<ul id="submenu">
<li><a href="{{ path('KekRozsakFrontBundle_groupView', {groupSlug: group.slug }) }}">Leírás</a></li>
<li><a href="{{ path('KekRozsakFrontBundle_groupMembers', {groupSlug: group.slug }) }}">Tagok</a></li>
</ul>
<h3>{{ group.name }} - Dokumentumok</h3>
{% endblock %}

View File

@@ -0,0 +1,19 @@
{% extends '::main_template.html.twig' %}
{% block title %} - {{ group.name }}{% endblock %}
{% block additional_css %}
<link rel="stylesheet" href="{{ asset('css/group.css') }}" type="text/css" />
{% endblock additional_css %}
{% block content %}
<ul id="submenu">
<li><a href="{{ path('KekRozsakFrontBundle_groupView', {groupSlug: group.slug }) }}">Leírás</a></li>
<li><a href="{{ path('KekRozsakFrontBundle_groupDocuments', {groupSlug: group.slug }) }}">Dokumentumok</a></li>
</ul>
<h3>{{ group.name }} - Tagok</h3>
<ul>
{% for user in group.members %}
{% if group.isMember(user.user) %}
<li>{{ user.user.displayName }}</li>
{% endif %}
{% endfor %}
</ul>
{% endblock %}

View File

@@ -0,0 +1,13 @@
{% extends '::main_template.html.twig' %}
{% block title %} - {{ group.name }}{% endblock %}
{% block additional_css %}
<link rel="stylesheet" href="{{ asset('css/group.css') }}" type="text/css" />
{% endblock additional_css %}
{% block content %}
<ul id="submenu">
<li><a href="{{ path('KekRozsakFrontBundle_groupMembers', {groupSlug: group.slug }) }}">Tagok</a></li>
<li><a href="{{ path('KekRozsakFrontBundle_groupDocuments', {groupSlug: group.slug }) }}">Dokumentumok</a></li>
</ul>
<h3>{{ group.name }}</h3>
{{ group.description }}
{% endblock %}