Skip to content

Commit

Permalink
Moved breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
alombarte committed Jul 1, 2012
1 parent 94fc452 commit 9aef78e
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 24 deletions.
4 changes: 3 additions & 1 deletion controllers/shared/header.ctrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ final public function build()

$this->setLayout( 'shared/header.tpl' );
$params = $this->getParams();
$this->assign( 'path', $params['path'] );
$path = explode( '/', $params['path'] );
$section = array_shift( $path );
$this->assign( 'section', $section );
$this->assign( 'menu_items', $menu_items );

}
Expand Down
6 changes: 4 additions & 2 deletions controllers/static/markdown.ctrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ public function buildChild()
// Get only immediate items, not the whole tree:
$docs = $dir->getList( dirname( $file ), array( 'md' ) );

$this->assign( 'section', $path );
$path = explode( '/', $path );
$this->assign( 'docs', $this->_formatFilesForMenu( $docs ) );
$this->assign( 'path', $path );
$section = array_shift( $path );
$this->assign( 'section', $section );

$this->assign( 'path', explode( '/', $path ) );
}
else
{
Expand Down
3 changes: 2 additions & 1 deletion public/static/css/generated/default.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion public/static/css/sifo.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ pre code { background-color: black; color: #FFF; } /* Prettify code blocks are o
#overview .float.right { float: right; }
#overview .float.left { float: left; }

#documentation { }
#documentation .breadcrumb { font-size: 11px; padding: 5px 10px; }
#documentation .breadcrumb .divider { padding: 0 1px; }
#documentation h1 { padding-bottom: 10px; }
#documentation h2 { color:#E30; padding-bottom: 5px; font-size: 20px; }
#documentation strong {}
Expand Down
2 changes: 1 addition & 1 deletion templates/shared/header.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="nav-collapse collapse">
<ul class="nav">
{ foreach from=$menu_items item=item}
<li{if $path==$item} class="active"{/if}><a href="{$url.base}/{$item}">{$item|replace:'-':' '|ucwords}</a></li>
<li{if $section==$item} class="active"{/if}><a href="{$url.base}/{$item}">{$item|replace:'-':' '|ucwords}</a></li>
{ /foreach}
<li><a href="https://github.com/alombarte/SIFO/issues">Issues</a></li>
<li><a href="https://groups.google.com/forum/?fromgroups#!forum/sifophp">Questions?</a></li>
Expand Down
37 changes: 19 additions & 18 deletions templates/static/docs.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,29 @@
<div class="row">
{ if count( $docs ) > 0}
<div class="span4 columns">
<ul class="breadcrumb">
<li>
<a href="{$url.base}">Home</a> <span class="divider">/</span>
</li>
{ assign var=complete value=''}
{ foreach $path as $p}
{ assign var=complete value="$complete/$p"}
{ if $p@last}
<li class="active">{$p|ucfirst|replace:'-':' '}</li>
{ else}
<li><a href="{$url.base}{$complete}">{$p|ucfirst|replace:'-':' '}</a> <span class="divider">/</span></li>
{ /if}



{ /foreach}

</ul>
<div id="navigation_box">
<nav>
<ul>
{ foreach from=$docs item=d}
<li{if $section==$d} class="selected"{/if}><a href="{$url.base}/{$d}">
<li{if implode('/',$path)==$d} class="selected"{/if}><a href="{$url.base}/{$d}">
{$d|regex_replace:"@(.*)/@":''|replace:'-':' '|ucfirst}
<i class="icon-chevron-right icon-white"></i>
</a>
Expand All @@ -22,25 +40,8 @@
</div>
{ /if}
<div class="{if count( $docs ) > 0}span8{else}span12{/if} columns">
<ul class="breadcrumb">
<li>
<a href="{$url.base}">Home</a> <span class="divider">/</span>
</li>
{ assign var=complete value=''}
{ foreach $path as $p}
{ assign var=complete value="$complete/$p"}
{ if $p@last}
<li class="active">{$p|ucfirst|replace:'-':' '}</li>
{ else}
<li><a href="{$url.base}{$complete}">{$p|ucfirst|replace:'-':' '}</a> <span class="divider">/</span></li>
{ /if}



{ /foreach}

</ul>

{ if isset($content)}{$content}{/if}
</div>

Expand Down

0 comments on commit 9aef78e

Please sign in to comment.