gitprep / templates / blob.html.ep /
Newer Older
130 lines | 4.055kb
cleanup
Yuki Kimoto authored on 2013-01-28
1
<%
use hoedown for fenced code ...
Qinhu Wang authored on 2014-03-11
2
  use Text::Markdown::Hoedown;
add support normal file mark...
Yuki Kimoto authored on 2013-10-08
3
  
cleanup
Yuki Kimoto authored on 2013-01-28
4
  # API
cleanup
Yuki Kimoto authored on 2013-04-29
5
  my $api = gitprep_api;
added branch long name featu...
Yuki Kimoto authored on 2013-05-12
6

            
7
  # Git
revert encoding support
Yuki Kimoto authored on 2013-11-22
8
  my $git = $self->app->git;
cleanup
Yuki Kimoto authored on 2013-01-28
9
  
added commit page
Yuki Kimoto authored on 2013-01-29
10
  # Parameters
cleanup
Yuki Kimoto authored on 2013-01-28
11
  my $user = param('user');
cleanup, rename repository t...
Yuki Kimoto authored on 2013-01-29
12
  my $project = param('project');
added branch long name featu...
Yuki Kimoto authored on 2013-05-12
13
  my $rev_file = param('rev_file');
14
  my ($rev, $file) = $git->parse_rev_path($user, $project, $rev_file);
cleanup
Yuki Kimoto authored on 2013-02-02
15

            
cleanup
Yuki Kimoto authored on 2013-01-28
16
  # Commit
added blob file type to blob...
Yuki Kimoto authored on 2013-05-02
17
  my $commit = $git->last_change_commit($user, $project, $rev, $file);
remove warning
Yuki Kimoto authored on 2014-02-17
18

            
added contributer count
Yuki Kimoto authored on 2013-01-28
19
  # Authors
cleanup
Yuki Kimoto authored on 2013-04-29
20
  my $authors = $git->authors($user, $project, $rev, $file);
added contributer count
Yuki Kimoto authored on 2013-01-28
21
  
cleanup blob and raw page
Yuki Kimoto authored on 2013-05-02
22
  # File size
cleanup
Yuki Kimoto authored on 2013-05-14
23
  my $file_size = $git->blob_size($user, $project, $rev, $file);
cleanup
Yuki Kimoto authored on 2013-01-28
24
  
added blob file type to blob...
Yuki Kimoto authored on 2013-05-02
25
  # File mode
26
  my $mode = $git->blob_mode($user, $project, $rev, $file);
27
  my $file_type = $git->file_type_long($mode);
28
  
cleanup blob and raw page
Yuki Kimoto authored on 2013-05-02
29
  # MIME type
cleanup
Yuki Kimoto authored on 2013-05-14
30
  my $mime_type = $git->blob_mime_type($user, $project, $rev, $file);
cleanup blob and raw page
Yuki Kimoto authored on 2013-05-02
31

            
fix bug that dispaly blog im...
Yuki Kimoto authored on 2014-03-17
32
  # Blob lines(only text)
33
  my $lines;
34
  $lines = $git->blob($user, $project, $rev, $file) if $mime_type =~ /^text/;
35

            
cleanup blob page
Yuki Kimoto authored on 2013-01-29
36
  # Variables for included template
added branch long name featu...
Yuki Kimoto authored on 2013-05-12
37
  stash(id => $rev, project => $project, rev => $rev);
cleanup
Yuki Kimoto authored on 2013-01-28
38
%>
39

            
add title
Yuki Kimoto authored on 2013-06-12
40
<% layout 'common' , title => "$project/$file at $rev \x{30fb} $user/$project",
41
     stylesheets => ['/js/google-code-prettify/prettify.css']; %>
cleanup
Yuki Kimoto authored on 2013-01-28
42

            
add title
Yuki Kimoto authored on 2013-06-12
43
%
cleanup
Yuki Kimoto authored on 2013-01-28
44
  %= include '/include/header';
45

            
improved code menu design
Yuki Kimoto authored on 2013-03-11
46
  <div class="container">
improve branch_select design
Yuki Kimoto authored on 2015-12-18
47
    <div style="margin-bottom:20px;">
improve blog page page path
Yuki Kimoto authored on 2015-12-19
48
      %= include '/include/branch_select', display => 'blob', Path => $file;
improve branch_select design
Yuki Kimoto authored on 2015-12-18
49
    </div>
complete blob page design
Yuki Kimoto authored on 2016-01-09
50

            
51
    <div class="commit-summary">
52
      <div class="commit-summary-left-container">
53
        <span class="commit-summary-author" title="<%= $commit->{author_email} %>"><%= $commit->{author_name} %></span>
54
        <a href="<%= url_for("/$user/$project/commit/$rev") %>">
improved blob header
Yuki Kimoto authored on 2013-01-28
55
          <%= $commit->{title} %>
56
        </a>
57
      </div>
complete blob page design
Yuki Kimoto authored on 2016-01-09
58
      <div class="commit-summary-right-container">
59
        <a href="<%= url_for("/$user/$project/commit/$commit->{id}") %>">
60
          <%= substr($commit->{id}, 0, 7) %>
61
        </a>
62
        <%= $commit->{age_string} %>
cleanup
Yuki Kimoto authored on 2013-01-28
63
      </div>
64
    </div>
complete blob page design
Yuki Kimoto authored on 2016-01-09
65
          
66
    <div class="commit-contributor">
67
      <%= @$authors %> contributor
68
    </div>
desinged blob page source
Yuki Kimoto authored on 2013-01-29
69

            
complete blob page design
Yuki Kimoto authored on 2016-01-09
70
    <div>
71
      <div class="file-header">
72
        <div class="file-header-left">
fix bug that dispaly blog im...
Yuki Kimoto authored on 2014-03-17
73
          % if ($lines) {
74
            <%= @$lines %> lines
complete blob page design
Yuki Kimoto authored on 2016-01-09
75
            <span style="color:#dcdcdc">|</span>
fix bug that dispaly blog im...
Yuki Kimoto authored on 2014-03-17
76
          % }
cleanup
Yuki Kimoto authored on 2013-04-29
77
          <%= $file_size %>kb
cleanup
Yuki Kimoto authored on 2013-03-15
78
        </div>
complete blob page design
Yuki Kimoto authored on 2016-01-09
79
        <div class="file-header-right">
80
          <ul>
81
            <li>
82
              <a class="btn btn-small" href="<%= url_for("/$user/$project/raw/$rev/$file") %>">Raw</a>
83
            </li>
84
            % if ($mime_type =~ m#^text/#) {
85
              <li>
86
                <a class="btn btn-small" href="<%= url_for("/$user/$project/blame/$rev/$file") %>">Blame</a>
87
              </li>
88
            % }
89
            <li>
90
              <a class="btn btn-small" href="<%= url_for("/$user/$project/commits/$rev/$file") %>">History</a>
91
            </li>
92
          </ul>
added file size to blob page
Yuki Kimoto authored on 2013-01-29
93
        </div>
desinged blob page source
Yuki Kimoto authored on 2013-01-29
94
      </div>
added google code prettify a...
Yuki Kimoto authored on 2013-03-15
95
    </div>
fix bug that dispaly blog im...
Yuki Kimoto authored on 2014-03-17
96
    % if ($mime_type =~ m#^image/#) {
complete blob page design
Yuki Kimoto authored on 2016-01-09
97
      <div class="blob-image">
cleanup
Yuki Kimoto authored on 2013-05-14
98
        <img type="<%= $mime_type %>
cleanup
Yuki Kimoto authored on 2013-04-29
99
          % if (defined $file) {
100
            alt="<%= $file %>" title="<%= $file %>"
cleanup
Yuki Kimoto authored on 2013-01-28
101
          % }
cleanup
Yuki Kimoto authored on 2013-04-29
102
          src="<%= url_for("/$user/$project/raw/$rev/$file") %>"
added google code prettify a...
Yuki Kimoto authored on 2013-03-15
103
        />
desinged blob page source
Yuki Kimoto authored on 2013-01-29
104
      </div>
not show binary file
Yuki Kimoto authored on 2013-06-02
105
    % } elsif ($mime_type =~ m#^text/#) {
fix bug that dispaly blog im...
Yuki Kimoto authored on 2014-03-17
106
      % if ($file =~ /\.md$/) {
107
        % my $readme = join "\n", @$lines;
add image support for markdo...
stone authored on 2015-11-05
108
        % $readme =~ s#^(\[.*\]:)(?!\s*https?://)\s*(\S*)#$1 /$user/$project/raw/$rev/$2#mg;
109
        % $readme =~ s#^(!\[.*\]\()(?!https?://)(\S*)#$1/$user/$project/raw/$rev/$2#mg;
fix bug that dispaly blog im...
Yuki Kimoto authored on 2014-03-17
110
        % my $readme_e = Text::Markdown::Hoedown::markdown($readme, extensions => HOEDOWN_EXT_FENCED_CODE);
improve markdown design
Yuki Kimoto authored on 2015-12-26
111
        <div class="markdown-body border-gray">
fix bug that dispaly blog im...
Yuki Kimoto authored on 2014-03-17
112
          <%== $readme_e %>
113
        </div>
114
      % } else {
115
        <pre class="prettyprint linenums"><% for my $line (@$lines) { %><%= "$line\n" %><% } %></pre>
116
      % }
not show binary file
Yuki Kimoto authored on 2013-06-02
117
    % } else {
complete blob page design
Yuki Kimoto authored on 2016-01-09
118
      <div class="blob-raw">
not show binary file
Yuki Kimoto authored on 2013-06-02
119
        <a href="<%= url_for("/$user/$project/raw/$rev/$file") %>">View raw</a>
120
      </div>
added google code prettify a...
Yuki Kimoto authored on 2013-03-15
121
    % }
copy gitweblite soruce code
root authored on 2012-11-23
122
  </div>
improved google-code-prittig...
Yuki Kimoto authored on 2013-03-24
123
  
124
  %= javascript '/js/google-code-prettify/prettify.js';
125
  %= javascript begin
126
    // Google prety print
127
    prettyPrint();
128
  % end
129
  
cleanup
Yuki Kimoto authored on 2013-01-28
130
  %= include '/include/footer';