gitprep / templates / blob.html.ep /
Newer Older
145 lines | 4.692kb
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');
cleanup parse_rev_path
Yuki Kimoto authored on 2016-04-16
14
  my ($rev, $file) = $git->parse_rev_path(app->rep_info($user, $project), $rev_file);
cleanup
Yuki Kimoto authored on 2013-02-02
15

            
cleanup
Yuki Kimoto authored on 2013-01-28
16
  # Commit
cleanup methods
Yuki Kimoto authored on 2016-04-16
17
  my $commit = $git->last_change_commit(app->rep_info($user, $project), $rev, $file);
add user page link from user...
Yuki Kimoto authored on 2016-04-11
18
  my $commit_author_mail = $commit->{author_email};
19
  my $commit_author_id = app->dbi->model('user')->select(
20
    'id',
21
    where => {mail => $commit_author_mail}
22
  )->value;
remove warning
Yuki Kimoto authored on 2014-02-17
23

            
added contributer count
Yuki Kimoto authored on 2013-01-28
24
  # Authors
cleanup blob_size
Yuki Kimoto authored on 2016-04-16
25
  my $authors = $git->authors(app->rep_info($user, $project), $rev, $file);
added contributer count
Yuki Kimoto authored on 2013-01-28
26
  
cleanup blob and raw page
Yuki Kimoto authored on 2013-05-02
27
  # File size
cleanup blob_size
Yuki Kimoto authored on 2016-04-16
28
  my $file_size = $git->blob_size(app->rep_info($user, $project), $rev, $file);
cleanup
Yuki Kimoto authored on 2013-01-28
29
  
added blob file type to blob...
Yuki Kimoto authored on 2013-05-02
30
  # File mode
cleanup blob_mode
Yuki Kimoto authored on 2016-04-16
31
  my $mode = $git->blob_mode(app->rep_info($user, $project), $rev, $file);
added blob file type to blob...
Yuki Kimoto authored on 2013-05-02
32
  my $file_type = $git->file_type_long($mode);
33
  
cleanup blob and raw page
Yuki Kimoto authored on 2013-05-02
34
  # MIME type
cleanup rep_info
Yuki Kimoto authored on 2016-04-16
35
  my $mime_type = $git->blob_mime_type(app->rep_info($user, $project), $rev, $file);
cleanup blob and raw page
Yuki Kimoto authored on 2013-05-02
36

            
fix bug that dispaly blog im...
Yuki Kimoto authored on 2014-03-17
37
  # Blob lines(only text)
38
  my $lines;
cleanup rep_info
Yuki Kimoto authored on 2016-04-16
39
  $lines = $git->blob(app->rep_info($user, $project), $rev, $file) if $mime_type =~ /^text/;
fix bug that dispaly blog im...
Yuki Kimoto authored on 2014-03-17
40

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

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

            
add title
Yuki Kimoto authored on 2013-06-12
48
%
cleanup
Yuki Kimoto authored on 2013-01-28
49
  %= include '/include/header';
50

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

            
56
    <div class="commit-summary">
57
      <div class="commit-summary-left-container">
add user page link from user...
Yuki Kimoto authored on 2016-04-11
58
        <span class="commit-summary-author" title="<%= $commit->{author_email} %>">
59
          % if (defined $commit_author_id) {
60
            <a href="<%= url_for("/$commit_author_id") %>"><%= $commit_author_id %></a>
61
          % } else {
62
            <%= $commit->{author_name} %>
63
          % }
64
        </span>
complete blob page design
Yuki Kimoto authored on 2016-01-09
65
        <a href="<%= url_for("/$user/$project/commit/$rev") %>">
improved blob header
Yuki Kimoto authored on 2013-01-28
66
          <%= $commit->{title} %>
67
        </a>
68
      </div>
complete blob page design
Yuki Kimoto authored on 2016-01-09
69
      <div class="commit-summary-right-container">
70
        <a href="<%= url_for("/$user/$project/commit/$commit->{id}") %>">
71
          <%= substr($commit->{id}, 0, 7) %>
72
        </a>
improve commits page design
Yuki Kimoto authored on 2016-01-11
73
        <span title="<%= $commit->{age_string_datetime_local} %>"><%= $commit->{age_string} %></span>
cleanup
Yuki Kimoto authored on 2013-01-28
74
      </div>
75
    </div>
complete blob page design
Yuki Kimoto authored on 2016-01-09
76
          
77
    <div class="commit-contributor">
78
      <%= @$authors %> contributor
79
    </div>
desinged blob page source
Yuki Kimoto authored on 2013-01-29
80

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