Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Change routes for post moderation for user friendlier route names +urls.
  • Loading branch information
reecefowell committed Apr 4, 2012
1 parent 5c9ada2 commit 04ae1b4
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Component/Dashboard/DashboardIntegrator.php
Expand Up @@ -45,7 +45,7 @@ public function getResources()
'Forum Moderation' => array(
'cc_moderator_forum_flagged_show_all' => array('auth' => 'ROLE_MODERATOR', 'url' => $this->baseUrl . '/' . $this->locale . '/moderate/forum/flagged/posts/show', 'name' => 'Flagged Posts', 'icon' => $this->basePath . '/bundles/ccdncomponentcommon/images/icons/Black/32x32/32x32_flag.png'),
'cc_moderator_forum_topics_closed_show_all' => array('auth' => 'ROLE_MODERATOR', 'url' => $this->baseUrl . '/' . $this->locale . '/moderate/forum/topic/show/closed', 'name' => 'Closed Topics', 'icon' => $this->basePath . '/bundles/ccdncomponentcommon/images/icons/Black/32x32/32x32_lock.png'),
'cc_moderator_forum_show_all_locked_posts' => array('auth' => 'ROLE_MODERATOR', 'url' => $this->baseUrl . '/' . $this->locale . '/moderate/forum/post/show/locked', 'name' => 'Locked Posts', 'icon' => $this->basePath . '/bundles/ccdncomponentcommon/images/icons/Black/32x32/32x32_lock.png'),
'cc_moderator_forum_posts_show_all_locked' => array('auth' => 'ROLE_MODERATOR', 'url' => $this->baseUrl . '/' . $this->locale . '/moderate/forum/post/show/locked', 'name' => 'Locked Posts', 'icon' => $this->basePath . '/bundles/ccdncomponentcommon/images/icons/Black/32x32/32x32_lock.png'),
),
),

Expand Down
8 changes: 4 additions & 4 deletions Controller/PostController.php
Expand Up @@ -54,7 +54,7 @@ public function showLockedAction($page)

// setup crumb trail.
$crumb_trail = $this->container->get('ccdn_component_crumb_trail.crumb_trail')
->add($this->container->get('translator')->trans('crumbs.post.locked.index', array(), 'CCDNForumModeratorBundle'), $this->container->get('router')->generate('cc_moderator_forum_show_all_locked_posts'), "home");
->add($this->container->get('translator')->trans('crumbs.post.locked.index', array(), 'CCDNForumModeratorBundle'), $this->container->get('router')->generate('cc_moderator_forum_posts_show_all_locked'), "home");

return $this->container->get('templating')->renderResponse('CCDNForumModeratorBundle:Post:show_locked.html.' . $this->getEngine(), array(
'user_profile_route' => $this->container->getParameter('ccdn_forum_moderator.user.profile_route'),
Expand Down Expand Up @@ -191,7 +191,7 @@ public function bulkAction()
//
if (count($itemIds) < 1)
{
return new RedirectResponse($this->container->get('router')->generate('cc_moderator_forum_show_all_locked_posts'));
return new RedirectResponse($this->container->get('router')->generate('cc_moderator_forum_posts_show_all_locked'));
}

$user = $this->container->get('security.context')->getToken()->getUser();
Expand All @@ -202,7 +202,7 @@ public function bulkAction()
{
$this->container->get('session')->setFlash('notice', $this->container->get('translator')->trans('flash.post.no_posts_found', array(), 'CCDNForumModeratorBundle'));

return new RedirectResponse($this->container->get('router')->generate('cc_moderator_forum_show_all_locked_posts'));
return new RedirectResponse($this->container->get('router')->generate('cc_moderator_forum_posts_show_all_locked'));
}

if (isset($_POST['submit_lock']))
Expand All @@ -222,7 +222,7 @@ public function bulkAction()
$this->container->get('ccdn_forum_forum.post.manager')->bulkSoftDelete($posts)->flushNow();
}

return new RedirectResponse($this->container->get('router')->generate('cc_moderator_forum_show_all_locked_posts'));
return new RedirectResponse($this->container->get('router')->generate('cc_moderator_forum_posts_show_all_locked'));
}


Expand Down
8 changes: 4 additions & 4 deletions Resources/config/routing.yml
Expand Up @@ -5,19 +5,19 @@ cc_moderator_forum_cp:
#
# Post Moderation.
#
cc_moderator_forum_show_all_locked_posts:
cc_moderator_forum_posts_show_all_locked:
pattern: /{_locale}/moderate/forum/post/show/locked
defaults: { _controller: CCDNForumModeratorBundle:Post:showLocked, _locale: en, page: 1 }

cc_moderator_forum_show_all_locked_posts_paginated:
cc_moderator_forum_posts_show_all_locked_paginated:
pattern: /{_locale}/moderate/forum/post/show/locked/page/{page}
defaults: { _controller: CCDNForumModeratorBundle:Post:showLocked, _locale: en, page: 1 }

cc_moderator_forum_lock_post:
cc_moderator_forum_post_lock:
pattern: /{_locale}/moderate/forum/post/{post_id}/lock
defaults: { _controller: CCDNForumModeratorBundle:Post:lock, _locale: en }

cc_moderator_forum_unlock_post:
cc_moderator_forum_post_unlock:
pattern: /{_locale}/moderate/forum/post/{post_id}/unlock
defaults: { _controller: CCDNForumModeratorBundle:Post:unlock, _locale: en }

Expand Down
2 changes: 1 addition & 1 deletion Resources/views/Flag/flag_mark.html.twig
Expand Up @@ -21,7 +21,7 @@
<div class="common_box_5 bg_header_smoke">
<div class="common_box_header"><span class="heading_glow">{{ 'sidebar.header.tools' | trans({}, 'CCDNForumModeratorBundle') }}</span></div>
<div class="common_box_panel"><a class="sidebar" href="{{ path('cc_moderator_forum_flagged_show_all', {}) }}">{{ 'sidebar.link.show_all_flagged_posts' | trans({}, 'CCDNForumModeratorBundle') }}</a></div>
<div class="common_box_panel"><a class="sidebar" href="{{ path('cc_moderator_forum_show_all_locked_posts', {}) }}">{{ 'sidebar.link.show_all_locked_posts' | trans({}, 'CCDNForumModeratorBundle') }}</a></div>
<div class="common_box_panel"><a class="sidebar" href="{{ path('cc_moderator_forum_posts_show_all_locked', {}) }}">{{ 'sidebar.link.show_all_locked_posts' | trans({}, 'CCDNForumModeratorBundle') }}</a></div>
<div class="common_box_panel"><a class="sidebar" href="{{ path('cc_moderator_forum_topics_closed_show_all', {}) }}">{{ 'sidebar.link.show_all_closed_topics' | trans({}, 'CCDNForumModeratorBundle') }}</a></div>
</div>
{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/Flag/show_flag.html.twig
Expand Up @@ -21,7 +21,7 @@
<div class="common_box_5 bg_header_smoke">
<div class="common_box_header"><span class="heading_glow">{{ 'sidebar.header.tools' | trans({}, 'CCDNForumModeratorBundle') }}</span></div>
<div class="common_box_panel"><a class="sidebar" href="{{ path('cc_moderator_forum_flagged_show_all', {}) }}">{{ 'sidebar.link.show_all_flagged_posts' | trans({}, 'CCDNForumModeratorBundle') }}</a></div>
<div class="common_box_panel"><a class="sidebar" href="{{ path('cc_moderator_forum_show_all_locked_posts', {}) }}">{{ 'sidebar.link.show_all_locked_posts' | trans({}, 'CCDNForumModeratorBundle') }}</a></div>
<div class="common_box_panel"><a class="sidebar" href="{{ path('cc_moderator_forum_posts_show_all_locked', {}) }}">{{ 'sidebar.link.show_all_locked_posts' | trans({}, 'CCDNForumModeratorBundle') }}</a></div>
<div class="common_box_panel"><a class="sidebar" href="{{ path('cc_moderator_forum_topics_closed_show_all', {}) }}">{{ 'sidebar.link.show_all_closed_topics' | trans({}, 'CCDNForumModeratorBundle') }}</a></div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion Resources/views/Flag/show_flagged.html.twig
Expand Up @@ -26,7 +26,7 @@
<div class="common_box_5 bg_header_smoke">
<div class="common_box_header"><span class="heading_glow">{{ 'sidebar.header.tools' | trans({}, 'CCDNForumModeratorBundle') }}</span></div>
<div class="common_box_panel"><a class="sidebar" href="{{ path('cc_moderator_forum_flagged_show_all', {}) }}">{{ 'sidebar.link.show_all_flagged_posts' | trans({}, 'CCDNForumModeratorBundle') }}</a></div>
<div class="common_box_panel"><a class="sidebar" href="{{ path('cc_moderator_forum_show_all_locked_posts', {}) }}">{{ 'sidebar.link.show_all_locked_posts' | trans({}, 'CCDNForumModeratorBundle') }}</a></div>
<div class="common_box_panel"><a class="sidebar" href="{{ path('cc_moderator_forum_posts_show_all_locked', {}) }}">{{ 'sidebar.link.show_all_locked_posts' | trans({}, 'CCDNForumModeratorBundle') }}</a></div>
<div class="common_box_panel"><a class="sidebar" href="{{ path('cc_moderator_forum_topics_closed_show_all', {}) }}">{{ 'sidebar.link.show_all_closed_topics' | trans({}, 'CCDNForumModeratorBundle') }}</a></div>
</div>

Expand Down
6 changes: 3 additions & 3 deletions Resources/views/Post/show_locked.html.twig
Expand Up @@ -26,7 +26,7 @@
<div class="common_box_5 bg_header_smoke">
<div class="common_box_header"><span class="heading_glow">{{ 'sidebar.header.tools' | trans({}, 'CCDNForumModeratorBundle') }}</span></div>
<div class="common_box_panel"><a class="sidebar" href="{{ path('cc_moderator_forum_flagged_show_all', {}) }}">{{ 'sidebar.link.show_all_flagged_posts' | trans({}, 'CCDNForumModeratorBundle') }}</a></div>
<div class="common_box_panel"><a class="sidebar" href="{{ path('cc_moderator_forum_show_all_locked_posts', {}) }}">{{ 'sidebar.link.show_all_locked_posts' | trans({}, 'CCDNForumModeratorBundle') }}</a></div>
<div class="common_box_panel"><a class="sidebar" href="{{ path('cc_moderator_forum_posts_show_all_locked', {}) }}">{{ 'sidebar.link.show_all_locked_posts' | trans({}, 'CCDNForumModeratorBundle') }}</a></div>
<div class="common_box_panel"><a class="sidebar" href="{{ path('cc_moderator_forum_topics_closed_show_all', {}) }}">{{ 'sidebar.link.show_all_closed_topics' | trans({}, 'CCDNForumModeratorBundle') }}</a></div>
</div>
{% endblock %}
Expand All @@ -51,7 +51,7 @@
</div>
{% if pager.haveToPaginate %}
<div class="pagerfanta">
{{ pagerfanta(pager, 'default', {'routeName':'cc_moderator_forum_show_all_locked_posts_paginated', 'routeParams':{}} ) }}
{{ pagerfanta(pager, 'default', {'routeName':'cc_moderator_forum_posts_show_all_locked_paginated', 'routeParams':{}} ) }}
</div>
{% endif %}
<div class="common_box_panel">
Expand Down Expand Up @@ -127,7 +127,7 @@
</div>
{% if pager.haveToPaginate %}
<div class="pagerfanta">
{{ pagerfanta(pager, 'default', {'routeName':'cc_moderator_forum_show_all_locked_posts_paginated', 'routeParams':{}} ) }}
{{ pagerfanta(pager, 'default', {'routeName':'cc_moderator_forum_posts_show_all_locked_paginated', 'routeParams':{}} ) }}
</div>
{% endif %}
</form>
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/Topic/show_closed.html.twig
Expand Up @@ -26,7 +26,7 @@
<div class="common_box_5 bg_header_smoke">
<div class="common_box_header"><span class="heading_glow">{{ 'sidebar.header.tools' | trans({}, 'CCDNForumModeratorBundle') }}</span></div>
<div class="common_box_panel"><a class="sidebar" href="{{ path('cc_moderator_forum_flagged_show_all', {}) }}">{{ 'sidebar.link.show_all_flagged_posts' | trans({}, 'CCDNForumModeratorBundle') }}</a></div>
<div class="common_box_panel"><a class="sidebar" href="{{ path('cc_moderator_forum_show_all_locked_posts', {}) }}">{{ 'sidebar.link.show_all_locked_posts' | trans({}, 'CCDNForumModeratorBundle') }}</a></div>
<div class="common_box_panel"><a class="sidebar" href="{{ path('cc_moderator_forum_posts_show_all_locked', {}) }}">{{ 'sidebar.link.show_all_locked_posts' | trans({}, 'CCDNForumModeratorBundle') }}</a></div>
<div class="common_box_panel"><a class="sidebar" href="{{ path('cc_moderator_forum_topics_closed_show_all', {}) }}">{{ 'sidebar.link.show_all_closed_topics' | trans({}, 'CCDNForumModeratorBundle') }}</a></div>
</div>
{% endblock %}
Expand Down

0 comments on commit 04ae1b4

Please sign in to comment.