Skip to content
This repository was archived by the owner on Apr 12, 2020. It is now read-only.
/ git-bundle Public archive

Commit 17ccd19

Browse files
author
alexandresalome
committed
cleanup
1 parent c7130b7 commit 17ccd19

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

Resources/doc/usage/blocks.rst

+5
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ And your template:
138138

139139
{{ git_tree(tree, revision, path) }}
140140

141+
{# or #}
142+
143+
{{ git_blob(blob) }}
144+
145+
141146
Another useful function when you're rendering a tree is what is called a "pathcrumb":
142147
a breadcrumb with all parent folders and links on them.
143148

Resources/public/css/all.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ span.git-author {
247247
margin: 0;
248248
font-size;: 1.5em;
249249
line-heig;ht: 1.5em;
250-
font-family: tellural;
250+
display: inline-block;
251251
}
252252

253253
.pathcrumb li {

Routing/GitUrlGenerator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class GitUrlGenerator extends AbstractGitUrlGenerator
1616
*/
1717
public function getName(Repository $repository)
1818
{
19-
$name = basename($repository->getGitDir());
19+
$name = basename($repository->getPath());
2020

2121
if (preg_match('/^(.*)\.git$/', $name, $vars)) {
2222
return $vars[1];

Twig/GitExtension.php

+11-4
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ public function getFunctions()
8383
new \Twig_SimpleFunction('git_url', array($this, 'getUrl')),
8484

8585
new \Twig_SimpleFunction('git_status', array($this, 'renderStatus'), array('is_safe' => array('html'), 'needs_environment' => true)),
86-
new \Twig_SimpleFunction('git_branches', array($this, 'renderBranches'), array('is_safe' => array('html'), 'needs_environment' => true)),
87-
new \Twig_SimpleFunction('git_tags', array($this, 'renderTags'), array('is_safe' => array('html'), 'needs_environment' => true)),
8886

8987
new \Twig_SimpleFunction('git_render', array($this, 'renderBlock'), array('is_safe' => array('html'), 'needs_environment' => true)),
9088
);
@@ -240,9 +238,18 @@ public function renderBlob($env, Blob $blob)
240238
return $this->renderBlock($env, $block, $args);
241239
}
242240

243-
public function renderLabel(\Twig_Environment $env, Revision $revision)
241+
public function renderLabel(\Twig_Environment $env, $revisions)
244242
{
245-
return $this->renderBlock($env, 'git_label_revision', array('revision' => $revision));
243+
if (!is_array($revisions)) {
244+
$revisions = array($revisions);
245+
}
246+
247+
$result = '';
248+
foreach ($revisions as $revision) {
249+
$result .= $this->renderBlock($env, 'git_label_revision', array('revision' => $revision));
250+
}
251+
252+
return $result;
246253
}
247254

248255
/**

0 commit comments

Comments
 (0)