diff --git a/app/Resources/views/Box/UserProfile.html.twig b/app/Resources/views/Box/UserProfile.html.twig index 9018abe..63c973b 100644 --- a/app/Resources/views/Box/UserProfile.html.twig +++ b/app/Resources/views/Box/UserProfile.html.twig @@ -9,7 +9,7 @@
Csoportjaim
{% for group in app.user.groups %} {% if group.group.open or group.membershipAcceptedAt %} -
{{ group.group.name }}
+
{{ group.group.name }}
{% endif %} {% endfor %}
További csoportok
diff --git a/src/KekRozsak/FrontBundle/Controller/GroupController.php b/src/KekRozsak/FrontBundle/Controller/GroupController.php index ae2a03b..b610d2c 100644 --- a/src/KekRozsak/FrontBundle/Controller/GroupController.php +++ b/src/KekRozsak/FrontBundle/Controller/GroupController.php @@ -5,6 +5,7 @@ namespace KekRozsak\FrontBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use KekRozsak\FrontBundle\Entity\UserGroupMembership; use KekRozsak\FrontBundle\Entity\Group; @@ -19,74 +20,64 @@ class GroupController extends Controller * @Route("/csoportok", name="KekRozsakFrontBundle_groupList") * @Template() */ - public function groupListAction() + public function listAction() { $groupRepo = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:Group'); - $groups = $groupRepo->findAll(array('name' => 'DESC')); + $groups = $groupRepo->findAll(array('name' => 'ASC')); + return array( 'groups' => $groups, ); } /** - * @Route("/csoport/{groupSlug}", name="KekRozsakFrontBundle_groupView") + * @Route("/csoport/{slug}", name="KekRozsakFrontBundle_groupView") * @Template() + * @ParamConverter("group") */ - public function groupViewAction($groupSlug) + public function viewAction(Group $group) { - $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") + * @Route("/csoport/{slug}/tagok", name="KekRozsakFrontBundle_groupMembers") * @Template() + * @ParamConverter("group") */ - public function groupMembersAction($groupSlug) + public function membersAction(Group $group) { - $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") + * @Route("/csoport/{slug}/dokumentumok", name="KekRozsakFrontBundle_groupDocuments") * @Template() + * @ParamConverter("group") */ - public function groupDocumentsAction($groupSlug) + public function documentsAction(Group $group) { - $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") + * @Route("/csoport/{slug}/belepes", name="KekRozsakFrontBundle_groupJoin") * @Template() + * @ParamConverter("group") */ - public function groupJoinAction($groupSlug) + public function joinAction(Group $group) { $user = $this->get('security.context')->getToken()->getUser(); - $groupRepo = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:Group'); - if (!($group = $groupRepo->findOneBySlug($groupSlug))) - throw $this->createNotFoundException('A kért csoport nem létezik!'); if ($group->isMember($user)) { - return $this->redirect($this->generateUrl('KekRozsakFrontBundle_groupView', array($groupSlug => $group->getSlug()))); + return $this->redirect($this->generateUrl('KekRozsakFrontBundle_groupView', array('slug' => $group->getSlug()))); } if ($group->isRequested($user)) @@ -113,7 +104,7 @@ class GroupController extends Controller if ($group->isOpen()) { - return $this->redirect($this->generateUrl('KekRozsakFrontBundle_groupView', array($groupSlug => $group->getSlug()))); + return $this->redirect($this->generateUrl('KekRozsakFrontBundle_groupView', array('slug' => $group->getSlug()))); } else { @@ -137,7 +128,7 @@ class GroupController extends Controller * @Route("/csoportok/uj", name="KekRozsakFrontBundle_groupCreate") * @Template() */ - public function groupCreateAction() + public function createAction() { $group = new Group(); $form = $this->createForm(new GroupType(), $group); diff --git a/src/KekRozsak/FrontBundle/Resources/views/Group/groupCreate.html.twig b/src/KekRozsak/FrontBundle/Resources/views/Group/create.html.twig similarity index 100% rename from src/KekRozsak/FrontBundle/Resources/views/Group/groupCreate.html.twig rename to src/KekRozsak/FrontBundle/Resources/views/Group/create.html.twig diff --git a/src/KekRozsak/FrontBundle/Resources/views/Group/groupDocuments.html.twig b/src/KekRozsak/FrontBundle/Resources/views/Group/documents.html.twig similarity index 59% rename from src/KekRozsak/FrontBundle/Resources/views/Group/groupDocuments.html.twig rename to src/KekRozsak/FrontBundle/Resources/views/Group/documents.html.twig index 0d85ec9..4f15e1d 100644 --- a/src/KekRozsak/FrontBundle/Resources/views/Group/groupDocuments.html.twig +++ b/src/KekRozsak/FrontBundle/Resources/views/Group/documents.html.twig @@ -1,3 +1,5 @@ +{# vim: ft=htmljinja +#} {% extends '::main_template.html.twig' %} {% block title %} - {{ group.name }}{% endblock %} {% block additional_css %} @@ -5,8 +7,7 @@ {% endblock additional_css %} {% block content %}

{{ group.name }} - Dokumentumok

@@ -20,7 +21,7 @@ {% for document in group.documents %} - +
[ikon]{{ document.title }}{{ document.title }} {{ document.createdBy.displayName }}
{{ document.createdAt|date('Y-m-d H:i') }} @@ -29,5 +30,5 @@ {% endfor %}
-Új dokumentum +Új dokumentum {% endblock %} diff --git a/src/KekRozsak/FrontBundle/Resources/views/Group/groupJoin.html.twig b/src/KekRozsak/FrontBundle/Resources/views/Group/join.html.twig similarity index 100% rename from src/KekRozsak/FrontBundle/Resources/views/Group/groupJoin.html.twig rename to src/KekRozsak/FrontBundle/Resources/views/Group/join.html.twig diff --git a/src/KekRozsak/FrontBundle/Resources/views/Group/groupList.html.twig b/src/KekRozsak/FrontBundle/Resources/views/Group/list.html.twig similarity index 82% rename from src/KekRozsak/FrontBundle/Resources/views/Group/groupList.html.twig rename to src/KekRozsak/FrontBundle/Resources/views/Group/list.html.twig index 72b197f..2d02b5f 100644 --- a/src/KekRozsak/FrontBundle/Resources/views/Group/groupList.html.twig +++ b/src/KekRozsak/FrontBundle/Resources/views/Group/list.html.twig @@ -1,3 +1,5 @@ +{# vim: ft=htmljinja +#} {% extends '::main_template.html.twig' %} {% block title %} - Csoportok{% endblock %} {% block content %} @@ -18,7 +20,7 @@ {% for group in groups %} [ikon] - {{ group.name }} + {{ group.name }} {% if group.isMember(app.user) %} [tag ikon] @@ -26,9 +28,9 @@ [jelentkeztél ikon] {% else %} {% if group.isOpen %} - [nyílt ikon] + [nyílt ikon] {% else %} - [zárt ikon] + [zárt ikon] {% endif %} {% endif %} diff --git a/src/KekRozsak/FrontBundle/Resources/views/Group/groupMembers.html.twig b/src/KekRozsak/FrontBundle/Resources/views/Group/members.html.twig similarity index 66% rename from src/KekRozsak/FrontBundle/Resources/views/Group/groupMembers.html.twig rename to src/KekRozsak/FrontBundle/Resources/views/Group/members.html.twig index 22b6df1..151b0d9 100644 --- a/src/KekRozsak/FrontBundle/Resources/views/Group/groupMembers.html.twig +++ b/src/KekRozsak/FrontBundle/Resources/views/Group/members.html.twig @@ -1,3 +1,5 @@ +{# vim: ft=htmljinja +#} {% extends '::main_template.html.twig' %} {% block title %} - {{ group.name }}{% endblock %} {% block additional_css %} @@ -5,8 +7,8 @@ {% endblock additional_css %} {% block content %}

{{ group.name }} - Tagok