From 91b6f9f8b9100ce9582a2cb1c59ec418fa054f43 Mon Sep 17 00:00:00 2001 From: Polonkai Gergely Date: Mon, 16 Jul 2012 17:05:23 +0200 Subject: [PATCH] Added group views --- app/Resources/views/main_template.html.twig | 8 ++++ .../Controller/DefaultController.php | 45 +++++++++++++++++++ .../views/Default/groupDocuments.html.twig | 12 +++++ .../views/Default/groupMembers.html.twig | 19 ++++++++ .../views/Default/groupView.html.twig | 13 ++++++ web/css/group.css | 11 +++++ 6 files changed, 108 insertions(+) create mode 100644 src/KekRozsak/FrontBundle/Resources/views/Default/groupDocuments.html.twig create mode 100644 src/KekRozsak/FrontBundle/Resources/views/Default/groupMembers.html.twig create mode 100644 src/KekRozsak/FrontBundle/Resources/views/Default/groupView.html.twig create mode 100644 web/css/group.css diff --git a/app/Resources/views/main_template.html.twig b/app/Resources/views/main_template.html.twig index 8beb9fe..4216459 100644 --- a/app/Resources/views/main_template.html.twig +++ b/app/Resources/views/main_template.html.twig @@ -4,10 +4,12 @@ Kék Rózsák{% block title %}{% endblock %} +{% block additional_css %}{% endblock %} +{% block additional_js %}{% endblock %}
@@ -22,6 +24,12 @@ Jogosultság
Csoportjaim
+{% for group in app.user.groups %} +{% if group.group.open or group.membershipAcceptedAt %} +
{{ group.group.name }}
+{% endif %} +
További csoportok
+{% endfor %}
Kedvenc Fórum-témáim
diff --git a/src/KekRozsak/FrontBundle/Controller/DefaultController.php b/src/KekRozsak/FrontBundle/Controller/DefaultController.php index 2d3294f..fe1d8d5 100644 --- a/src/KekRozsak/FrontBundle/Controller/DefaultController.php +++ b/src/KekRozsak/FrontBundle/Controller/DefaultController.php @@ -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() diff --git a/src/KekRozsak/FrontBundle/Resources/views/Default/groupDocuments.html.twig b/src/KekRozsak/FrontBundle/Resources/views/Default/groupDocuments.html.twig new file mode 100644 index 0000000..3bebdff --- /dev/null +++ b/src/KekRozsak/FrontBundle/Resources/views/Default/groupDocuments.html.twig @@ -0,0 +1,12 @@ +{% extends '::main_template.html.twig' %} +{% block title %} - {{ group.name }}{% endblock %} +{% block additional_css %} + +{% endblock additional_css %} +{% block content %} + +

{{ group.name }} - Dokumentumok

+{% endblock %} diff --git a/src/KekRozsak/FrontBundle/Resources/views/Default/groupMembers.html.twig b/src/KekRozsak/FrontBundle/Resources/views/Default/groupMembers.html.twig new file mode 100644 index 0000000..22b6df1 --- /dev/null +++ b/src/KekRozsak/FrontBundle/Resources/views/Default/groupMembers.html.twig @@ -0,0 +1,19 @@ +{% extends '::main_template.html.twig' %} +{% block title %} - {{ group.name }}{% endblock %} +{% block additional_css %} + +{% endblock additional_css %} +{% block content %} + +

{{ group.name }} - Tagok

+
    +{% for user in group.members %} +{% if group.isMember(user.user) %} +
  • {{ user.user.displayName }}
  • +{% endif %} +{% endfor %} +
+{% endblock %} diff --git a/src/KekRozsak/FrontBundle/Resources/views/Default/groupView.html.twig b/src/KekRozsak/FrontBundle/Resources/views/Default/groupView.html.twig new file mode 100644 index 0000000..36ae2ff --- /dev/null +++ b/src/KekRozsak/FrontBundle/Resources/views/Default/groupView.html.twig @@ -0,0 +1,13 @@ +{% extends '::main_template.html.twig' %} +{% block title %} - {{ group.name }}{% endblock %} +{% block additional_css %} + +{% endblock additional_css %} +{% block content %} + +

{{ group.name }}

+{{ group.description }} +{% endblock %} diff --git a/web/css/group.css b/web/css/group.css new file mode 100644 index 0000000..bcc4d50 --- /dev/null +++ b/web/css/group.css @@ -0,0 +1,11 @@ +ul#submenu { + margin: 0; + padding: 0; +} + +ul#submenu li { + margin: 0; + padding: 3px; + display: inline; +} +