Navigation Menu

Skip to content

Commit

Permalink
fix dashboard integration
Browse files Browse the repository at this point in the history
  • Loading branch information
reecefowell committed Dec 17, 2013
1 parent 4a43d72 commit 200e18a
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 195 deletions.
4 changes: 2 additions & 2 deletions Component/Integrator/Registry/DashboardRegistry.php
Expand Up @@ -28,7 +28,7 @@ class DashboardRegistry
{
/**
*
* @access protected
* @access protected
*/
protected $integratorChain;

Expand All @@ -49,7 +49,7 @@ class DashboardRegistry
/**
*
* @access public
* @param $container
* @param $container
*/
public function __construct($integratorChain, $builder)
{
Expand Down
9 changes: 0 additions & 9 deletions Controller/BaseController.php
Expand Up @@ -318,13 +318,4 @@ public function getQuery($query, $default)
{
return $this->getRequest()->query->get($query, $default);
}

/**
*
* @access protected
*/
protected function getCrumbs()
{
return $this->container->get('ccdn_component_crumb_trail.component.trail');
}
}
35 changes: 10 additions & 25 deletions Controller/DashboardController.php
Expand Up @@ -40,18 +40,11 @@ public function indexAction()
$categories = $registry->getCategories();
$pages = $registry->getPages();

// setup crumb trail.
$crumbs = $this->getCrumbs()
->add($this->trans('ccdn_component_dashboard.crumbs.category.index'), $this->path('ccdn_component_dashboard_index'));

return $this->renderResponse('CCDNComponentDashboardBundle:Dashboard:show.html.',
array(
'crumbs' => $crumbs,
'pages' => $pages,
'currentPage' => 'default',
'categories' => $categories,
)
);
return $this->renderResponse('CCDNComponentDashboardBundle:User:Dashboard/show.html.', array(
'pages' => $pages,
'currentPage' => 'default',
'categories' => $categories,
));
}

/**
Expand All @@ -67,18 +60,10 @@ public function showAction($pageName)
$categories = $registry->getCategoriesForPage($pageName);
$pages = $registry->getPages();

// setup crumb trail.
$crumbs = $this->getCrumbs()
->add($this->trans('ccdn_component_dashboard.crumbs.category.index'), $this->path('ccdn_component_dashboard_index'))
->add($pageName, $this->path('ccdn_component_dashboard_show', array('pageName' => $pageName)));

return $this->renderResponse('CCDNComponentDashboardBundle:Dashboard:show.html.',
array(
'crumbs' => $crumbs,
'pages' => $pages,
'currentPage' => $pageName,
'categories' => $categories,
)
);
return $this->renderResponse('CCDNComponentDashboardBundle:User:Dashboard/show.html.',array(
'pages' => $pages,
'currentPage' => $pageName,
'categories' => $categories,
));
}
}
9 changes: 8 additions & 1 deletion DependencyInjection/Configuration.php
Expand Up @@ -33,6 +33,13 @@
*/
class Configuration implements ConfigurationInterface
{
/**
*
* @access protected
* @var string $defaultValueLayoutTemplate
*/
protected $defaultValueLayoutTemplate = 'CCDNComponentDashboardBundle::base.html.twig';

/**
*
* @access public
Expand Down Expand Up @@ -150,7 +157,7 @@ private function addDashboardSection(ArrayNodeDefinition $node)
->arrayNode('show')
->addDefaultsIfNotSet()
->children()
->scalarNode('layout_template')->defaultValue('CCDNComponentCommonBundle:Layout:layout_body_right.html.twig')->end()
->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
->end()
->end()
->end()
Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/example_usage.md
Expand Up @@ -96,7 +96,7 @@ ccdn_component_common:
header_bar_links:
- { bundle: CCDNComponentDashboardBundle, label: 'ccdn_component_dashboard.layout.header_links.dashboard', route: 'ccdn_component_dashboard_index' }
- { bundle: CCDNUserMemberBundle, label: 'ccdn_user_member.layout.header_links.members', route: 'ccdn_user_member_index'}
- { bundle: CCDNForumForumBundle, label: 'ccdn_forum_forum.layout.header_links.forum', route: ccdn_forum_forum_index }
- { bundle: CCDNForumForumBundle, label: 'ccdn_forum_forum.layout.header_links.forum', route: ccdn_forum_user_category_index }
```

- [Return back to the docs index](index.md).
71 changes: 0 additions & 71 deletions Resources/views/Dashboard/show.html.twig

This file was deleted.

17 changes: 0 additions & 17 deletions Resources/views/Footer/footer.html.twig

This file was deleted.

177 changes: 108 additions & 69 deletions Resources/views/base.html.twig
@@ -1,75 +1,114 @@
{% extends LayoutTemplate %}



{% block stylesheets %}
{{ parent() }}
{% block stylesheets_extra %}
{% endblock stylesheets_extra %}

<style type="text/css">
section {border-bottom:none;}
.page-footer {border-top:1px solid #eee !important;}
</style>
{% endblock stylesheets %}



{% block javascripts %}
{{ parent() }}
{% block javascripts_extra %}
{% endblock javascripts_extra %}
{% endblock javascripts %}


{% block tool_bar %}
{%- spaceless -%}
<header>
<div class="container-fluid clear-top crumb-bar-container">
<div class="row-fluid">
<div class="span2">
<h3>
{% block sub_title %}
<a href="{{ path('ccdn_component_dashboard_index') }}">
{{- 'ccdn_component_dashboard.title.dashboard' | trans({}, 'CCDNComponentDashboardBundle') -}}
</a>
{% endblock sub_title %}
</h3>
</div>

{%- if crumbs is defined -%}
<nav class="span10">
{%- block crumb_trail -%}
{%- include 'CCDNComponentCrumbTrailBundle:Trail:trail.html.twig' with {'crumbs': crumbs } -%}
{%- endblock crumb_trail -%}
</nav>
{%- endif -%}
<!DOCTYPE html>
<html lang="{{- app.request.locale -}}">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>{%- block title -%}{%- endblock -%}</title>

<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
{%- block stylesheets -%}
{%- endblock -%}
</head>
<body>

{%- spaceless -%}

<div id="page-wrap">
<div id="page-main">

{%- block navbar -%}
<header class="navbar navbar-default navbar-fixed-top clearfix" role="navigation">
<a target="_blank" class="navbar-brand" href="http://www.codeconsortium.com/">Code Consortium</a>

<p class="navbar-text pull-right">
<i class="glyphicon glyphicon-user"></i>
&nbsp;
{%- if app.user -%}
{{- app.user.email -}}
{%- endif -%}
</p>
</header>

{%- block tool_bar -%}
{%- endblock tool_bar -%}
{%- endblock navbar -%}

<div class="container clearfix">
<br>
<div class="row">
<aside class="col-md-2 page-sidebar-left">
{%- block sidebar -%}
{%- endblock sidebar -%}
</aside>

<div class="col-md-10 page-body-right">
<div id="top clearfix"></div>
{%- block body -%}
{%- endblock body -%}
</div>
</div>
</div>
</div>
</header>
{%- endspaceless -%}
{% endblock tool_bar %}
</div>

<br>

{% block sidebar %}
{{ parent() }}
<footer class="footer site-footer">

{%- block sidebar_extra_top -%}{%- endblock sidebar_extra_top -%}
{%- block sidebar_extra_bottom -%}{%- endblock sidebar_extra_bottom -%}

{% endblock %}



{% block body %}
{%- spaceless -%}

{%- block body_content -%}
{%- endblock body_content -%}

{%- block body_footer -%}
{%- include 'CCDNComponentDashboardBundle:Footer:footer.html.twig' -%}
{%- endblock body_footer -%}
<div class="navbar navbar-default clearfix">
<p class="navbar-text pull-right content-right">
Copyright <a target="_blank" class="navbar-link" href="http://www.codeconsortium.com/">Code Consortium</a> 2011 - {{ 'now'|date("Y") }}.
</p>
</div>

{%- endspaceless -%}
{% endblock body %}
<nav class="navbar navbar-inverse clearfix" style="bottom:0px;margin-bottom:0px;">
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li>
<a href="http://www.codeconsortium.com">
Code Consortium
</a>
</li>

<li>
<a rel="friend" target="_blank" href="http://github.com/codeconsortium">Contribute</a>
</li>
</ul>
</div>
</nav>

</footer>

<script src="//code.jquery.com/jquery.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
{%- block javascripts -%}
{%- endblock -%}

<script type='text/javascript'>
<!--
$(document).ready(function() {
// make visible js compat toolbars site wide
$("[data-js-non-compat]").each(function(i, el) {
$(el).addClass('collapse').addClass('hidden');
});
$("[data-js-compat]").each(function(i, el) {
$(el).removeClass('collapse').removeClass('hidden');
});
$('[data-tip]').each(function() {
$(this).tooltip({
html: true,
placement: $(this).data('tip')
});
});
$('[data-toggle="dropdown"]').dropdown();
});
//-->
</script>

{%- endspaceless -%}
</body>
</html>

0 comments on commit 200e18a

Please sign in to comment.