moved the page variable to the templates (belongs to the view)

This commit is contained in:
Fabien Potencier
2012-07-06 23:02:33 +02:00
parent cddca4683a
commit de1cf7320f
10 changed files with 12 additions and 7 deletions

View File

@@ -7,7 +7,6 @@ $app->get('{repo}/blob/{branch}/{file}/', function($repo, $branch, $file) use($a
$fileType = $app['utils']->getFileType($file); $fileType = $app['utils']->getFileType($file);
return $app['twig']->render('file.twig', array( return $app['twig']->render('file.twig', array(
'page' => 'files',
'file' => $file, 'file' => $file,
'fileType' => $fileType, 'fileType' => $fileType,
'blob' => $blob->output(), 'blob' => $blob->output(),

View File

@@ -12,7 +12,6 @@ $app->get('{repo}/commits/{branch}', function($repo, $branch) use($app) {
} }
return $app['twig']->render('commits.twig', array( return $app['twig']->render('commits.twig', array(
'page' => 'commits',
'pager' => $pager, 'pager' => $pager,
'repo' => $repo, 'repo' => $repo,
'branch' => $branch, 'branch' => $branch,
@@ -37,7 +36,6 @@ $app->get('{repo}/commits/{branch}/{file}/', function($repo, $branch, $file) use
} }
return $app['twig']->render('commits.twig', array( return $app['twig']->render('commits.twig', array(
'page' => 'commits',
'pager' => $pager, 'pager' => $pager,
'repo' => $repo, 'repo' => $repo,
'branch' => $branch, 'branch' => $branch,
@@ -54,7 +52,6 @@ $app->get('{repo}/commit/{commit}/', function($repo, $commit) use($app) {
$commit = $repository->getCommit($commit); $commit = $repository->getCommit($commit);
return $app['twig']->render('commit.twig', array( return $app['twig']->render('commit.twig', array(
'page' => 'commits',
'branch' => 'master', 'branch' => 'master',
'repo' => $repo, 'repo' => $repo,
'commit' => $commit, 'commit' => $commit,
@@ -68,7 +65,6 @@ $app->get('{repo}/blame/{branch}/{file}/', function($repo, $branch, $file) use($
$blames = $repository->getBlame("$branch -- $file"); $blames = $repository->getBlame("$branch -- $file");
return $app['twig']->render('blame.twig', array( return $app['twig']->render('blame.twig', array(
'page' => 'commits',
'file' => $file, 'file' => $file,
'repo' => $repo, 'repo' => $repo,
'branch' => $branch, 'branch' => $branch,

View File

@@ -6,7 +6,6 @@ $app->get('{repo}/stats/{branch}', function($repo, $branch) use($app) {
$authors = $repository->getAuthorStatistics(); $authors = $repository->getAuthorStatistics();
return $app['twig']->render('stats.twig', array( return $app['twig']->render('stats.twig', array(
'page' => 'stats',
'repo' => $repo, 'repo' => $repo,
'branch' => $branch, 'branch' => $branch,
'branches' => $repository->getBranches(), 'branches' => $repository->getBranches(),

View File

@@ -16,7 +16,6 @@ $app->get('{repo}/tree/{branch}/{tree}/', $treeController = function($repo, $bra
} }
return $app['twig']->render('tree.twig', array( return $app['twig']->render('tree.twig', array(
'page' => 'files',
'files' => $files->output(), 'files' => $files->output(),
'repo' => $repo, 'repo' => $repo,
'branch' => $branch, 'branch' => $branch,

View File

@@ -1,5 +1,7 @@
{% extends 'layout_page.twig' %} {% extends 'layout_page.twig' %}
{% set page = 'commits' %}
{% block title %}GitList{% endblock %} {% block title %}GitList{% endblock %}
{% block content %} {% block content %}

View File

@@ -1,5 +1,7 @@
{% extends 'layout_page.twig' %} {% extends 'layout_page.twig' %}
{% set page = 'commits' %}
{% block title %}GitList{% endblock %} {% block title %}GitList{% endblock %}
{% block content %} {% block content %}

View File

@@ -1,5 +1,7 @@
{% extends 'layout_page.twig' %} {% extends 'layout_page.twig' %}
{% set page = 'commits' %}
{% block title %}GitList{% endblock %} {% block title %}GitList{% endblock %}
{% block content %} {% block content %}

View File

@@ -1,5 +1,7 @@
{% extends 'layout_page.twig' %} {% extends 'layout_page.twig' %}
{% set page = 'files' %}
{% block title %}GitList{% endblock %} {% block title %}GitList{% endblock %}
{% block content %} {% block content %}

View File

@@ -1,5 +1,7 @@
{% extends 'layout_page.twig' %} {% extends 'layout_page.twig' %}
{% set page = 'stats' %}
{% block title %}GitList{% endblock %} {% block title %}GitList{% endblock %}
{% block content %} {% block content %}

View File

@@ -1,5 +1,7 @@
{% extends 'layout_page.twig' %} {% extends 'layout_page.twig' %}
{% set page = 'files' %}
{% block title %}GitList{% endblock %} {% block title %}GitList{% endblock %}
{% block content %} {% block content %}