=head1 SEE ALSO
L<Gitalist::Git::CollectionOfRepositories>,
-L<Gitalist::Git::Repository>,
+L<Gitalist::Git::Repository>,
L<Gitalist::Git::CollectionOfRepositories::FromDirectory>
=head1 AUTHORS
use List::MoreUtils qw/any zip/;
use Encode qw/decode/;
- use if $^O ne 'MSWin32' => 'I18N::Langinfo', qw/langinfo CODESET/;
+ use if $^O ne 'MSWin32' => 'I18N::Langinfo', qw/langinfo CODESET/;
use Gitalist::Git::Object::Blob;
use Gitalist::Git::Object::Tree;
# Don't bother with anything over 64kb, it'll be tragically slow.
return encode_entities $blob if length $blob > 8192;
-
+
my $lang = $args->{language};
my $ret;
</tbody>
</table>
<!-- [% USE dumper; dumper.dump(commit.parents) %] -->
-
-
-
+
+
+
<table class="listing summary">
<tr>
<td class='sha1'>[% INCLUDE 'inc/chroma_hash.tt2' sha1 = Commit.sha1.substr(0, 7), hide_sha1_output = 1 %] <div class="sha1_label">Commit</div></td>
<a href="[% c.uri_for_action('/ref/diff_fancy', [Repository.name, parent.sha1]) %]" title="Difference" class="button diff">diff</a>
</td>
</tr>
-[% END %]
+[% END %]
</table>
<td><input type="radio" name="sha1_b" value="[% line.sha1 %]"[% " checked" IF loop.count == 1 %]/></td>
<td class='sha1' title='[% line.sha1 %]'>[% INCLUDE 'inc/chroma_hash.tt2' sha1 = line.sha1.substr(0, 7) %]</td>
<td class='time-since' title='[% line.authored_time %]'>[% time_since(line.authored_time) %]</td>
-
+
<td>
[% short_cmt(line.comment) | html %]
[% INCLUDE '_refs.tt2' object = line.0 %]
</form>
<span id='compare-path' class='js-data'>[% filename %]</span>
-<span id="diff-uri" class='js-data'>[% c.uri_for_action('/ref/diff_fancy', [Repository.name, 'HEAD']) %]</span>
+<span id="diff-uri" class='js-data'>[% c.uri_for_action('/ref/diff_fancy', [Repository.name, 'HEAD']) %]</span>
[% INCLUDE 'inc/history_pager.tt2' %]
[% END %]
[%-
SET counter = 1;
-
+
# sort files and folders
SET tree_files = [];
SET tree_folders = [];
line.comment | html;
ELSE;
short_cmt(line.comment) | html;
-
+
END;
-%]</p>[% INCLUDE '_refs.tt2' object = line %]</td>
<td class='author'>[% INCLUDE 'inc/gravatar.tt2' email = line.author.email %][% line.author.name | html %]</td>
</table>
</form>
-<span id="diff-uri" class="js-data">[% c.uri_for_action('/ref/diff_fancy', [Repository.name, 'HEAD']) %]</span>
+<span id="diff-uri" class="js-data">[% c.uri_for_action('/ref/diff_fancy', [Repository.name, 'HEAD']) %]</span>
[% INCLUDE 'inc/log_pager.tt2' %]
[% IF ((page.defined && page > 0) || !page.defined) && (log_lines.first.sha1 != Commit.sha1 || (log_lines.size != c.config.paging.log && page)) %]
<li class="pager_prev"><a href='[% c.uri_with(pg => (page||0) - 1) %]'>« Newer commits</a></li>
[% END %]
-
+
[% IF log_lines.size == c.config.paging.log %]
<li class="pager_next"><a href='[% c.uri_with(pg => (page||0) + 1) %]'>Older commits »</a></li>
[% END %]
[% IF log_lines.first.sha1 != Commit.sha1 || (log_lines.size != c.config.paging.log && page) %]
<li class="pager_prev"><a href='[% c.uri_with(pg => (page||0) + 1) %]'>« Newer commits</a></li>
[% END %]
-
+
[% IF log_lines.size == c.config.paging.log %]
<li class="pager_next"><a href='[% c.uri_with(pg => (page||0) - 1) %]'>Older commits »</a></li>
[% END %]
<div id="page-search">
<form method="get" action="[% c.uri_for_action('/repository/search', [Repository.name]) %]" enctype="application/x-www-form-urlencoded">
Search
-
+
<input type="text" name="text" value="[% c.req.param('s') %]" />
<select name="type">
<option value="commit">commit</option>
</select>
<span title="Extended regular expression"><label><input type="checkbox" name="regexp" value="1">re</label></span>
<sup><a href="[% c.uri_for_action('/search_help') %]">?</a></sup>
-
+
<input type="submit" class="button_submit" value="" />
</form>
</div>
[% subinclude('/fragment/ref/blob', c.req.captures, c.req.args.to_path) %]
-
+
#debug_holder{
-
+
display:none;
-
+
clear:both;
padding-top:30px;
margin:30px 0;
color: purple;
}
span.Normal {
-
+
}
span.String {
background-color:#CCF5CC;
do {
curleft += obj.offsetLeft;
curtop += obj.offsetTop;
- }
+ }
while (obj = obj.offsetParent);
return [curleft,curtop];
}
title;
-%] (Gitalist)</title>
[% INCLUDE '_header_feeds.tt2' %]
-
+
<link rel="stylesheet" type="text/css" href="[% c.uri_for('/core.css') %]" />
<link rel="shortcut icon" href="[% c.uri_for('/static/favicon.ico') %]" />
<script src="[% c.uri_for('/static/js/jquery.min.js') %]"></script>
<div class="search">
[% IF Repository; INCLUDE 'nav/search.tt2'; ELSE; %]
-
+
<!--
[%# FIXME - Search submits to blank(ish) page %]
<form method="get" action="[% c.uri_for_action('/search') %]" enctype="application/x-www-form-urlencoded">
[% END %]
</div>
</div>
-
-
+
+
<div id="nav_logs" [% 'style="visibility:hidden"' IF c.action.name == "index" %]>
-
+
[% IF c.req.captures.size == 1; SET path = 'repository'; ELSE; SET path = 'ref'; END %]
-
+
<ul>
<li[% ' class="selected"' IF c.action.name.match('tree') %]><a href="[% c.uri_for_action('/ref/tree', c.req.captures) || c.uri_for_action('/repository/tree', c.req.captures) %]" id="tree">Tree</a></li>
<li[% ' class="selected"' IF c.action.name.match('longlog') %]><a href="[% c.uri_for_action('/' _ path _ '/longlog', c.req.captures) %]" id="log_full">Long log</a></li>
-
+
<li[% ' class="selected"' IF c.action.name.match('shortlog') %]><a href="[% c.uri_for_action('/' _ path _ '/shortlog', c.req.captures) %]" id="log_short">Short log</a></li>
-
+
<li id="branch_selector">
- Branches
+ Branches
<select id='branch-list'>
<option value="">HEAD</option>
[%- FOREACH branch IN Repository.heads -%]
[% LAST %]
[% END %]
[% END -%]
-
+
</select>
</li>
-
+
</ul>
</div>
-
+
<h1>
<a href="[% c.uri_for('/') %]">Home</a>
-
+
[%- IF Repository %]
/ <a href="[% c.uri_for_action('/repository/summary', [Repository.name]) %]">[% Repository.name %]</a>
[%- END %]
[% END -%]
[% END -%]
[%- END %]
-
-
- [%-
-
+
+
+ [%-
+
#FIXME on a history view of a folder, don't show extra actions in dropdown
SET on_file_page = 1;
-
+
SET actions_list = {
"blob" => 1,
"raw" => 1,
"blame" => 1,
"history" => 1,
};
-
+
SET action_name = c.action.name
.replace("_"," ")
.replace("log", " log")
ELSE;
action_name_ucfirst;
END;
-
+
-%]
</h1>
-
- [%-
+
+ [%-
IF actions_list.$action_name;
'<ul id="actions_nav_list">';
FOREACH action IN actions_list;
action_output = action.key FILTER ucfirst;
- NEXT IF action_output == action_name_ucfirst;
+ NEXT IF action_output == action_name_ucfirst;
action = action.key;
'<li><a href="' _ c.uri_for("/") _ c.req.path.replace(action_name, action) _ '">' _ action_output _ '</a></li>';
- END;
+ END;
'</ul>';
END;
-%]
-
+
</div>
</div>
-
+
<div id="content_holder">
<div id="content" class="sub_holder">
<div id="content_inner">
-
+
[% content %]
-
+
</div>
</div>
</div>
<div id="footer_holder">
<div id="footer" class="sub_holder">
-
+
<p>[% IF Repository; Repository.description | html IF Repository.description != "Unnamed repository; edit this file to name it for gitweb." ; END; %]</p>
-
+
<a title="git homepage" href="http://git-scm.org"><img src="[% c.uri_for('/logo.png') %]" id="git_logo" alt="git" /></a>
-
+
<div id="feeds">
[% INCLUDE 'inc/footer_feeds.tt2' %]
</div>
<div id="debug" class="sub_holder">
<p>Debug:</p>
-
+
[% USE Dumper %]
<pre>
[% Repository.path %]
[% Dumper.dump(c.req.args) %]
</pre>
-
+
</div>
</div>
# show repository only if this file exists
# (only effective if this variable evaluates to true)
-# export_ok
+# export_ok
# XXX Code in config FAIL
# show repository only if this subroutine returns true
sub test_uri {
my ($uri, $qs) = @_;
- my $request = "/$uri";
+ my $request = "/$uri";
$request .= "?$qs" if defined $qs;
my $response = request($request);
ok($response->is_success || $response->is_redirect, "ok $request");