gitprep / templates / blob.html.ep /
Newer Older
143 lines | 4.603kb
cleanup
Yuki Kimoto authored on 2013-01-28
1
<%
2
  # API
cleanup
Yuki Kimoto authored on 2013-04-29
3
  my $api = gitprep_api;
added branch long name featu...
Yuki Kimoto authored on 2013-05-12
4

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

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

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

            
fix bug that dispaly blog im...
Yuki Kimoto authored on 2014-03-17
35
  # Blob lines(only text)
36
  my $lines;
cleanup rep_info
Yuki Kimoto authored on 2016-04-16
37
  $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
38

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

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

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

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

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

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