gitprep / templates / commit.html.ep /
Newer Older
147 lines | 4.721kb
cleanup
Yuki Kimoto authored on 2013-01-28
1
<%
2
  # API
cleanup
Yuki Kimoto authored on 2013-03-19
3
  my $api = gitprep_api;
cleanup
Yuki Kimoto authored on 2013-01-28
4
  
cleanup
Yuki Kimoto authored on 2013-02-01
5
  # Paramters
cleanup, rename repository t...
Yuki Kimoto authored on 2013-01-29
6
  my $project = param('project');
cleanup
Yuki Kimoto authored on 2013-02-01
7
  my $diff = param('diff');
cleanup
Yuki Kimoto authored on 2013-05-31
8
  my ($from_rev, $rev) = $diff =~ /(.+)\.\.(.+)/;
9
  $rev = $diff unless defined $rev;
cleanup
Yuki Kimoto authored on 2013-01-28
10
  
11
  # Git
revert encoding support
Yuki Kimoto authored on 2013-11-22
12
  my $git = app->git;
cleanup
Yuki Kimoto authored on 2013-02-01
13
  
cleanup
Yuki Kimoto authored on 2013-01-28
14
  # Commit
cleanup
Yuki Kimoto authored on 2013-05-31
15
  my $commit = $git->get_commit($user, $project, $rev);
remove warning
Yuki Kimoto authored on 2014-02-17
16
  
cleanup
Yuki Kimoto authored on 2013-05-13
17
  unless ($commit) {
do success xt tests
Yuki Kimoto authored on 2016-03-25
18
    $self->reply->not_found;
cleanup
Yuki Kimoto authored on 2013-05-13
19
    return;
20
  }
cleanup
Yuki Kimoto authored on 2013-01-28
21
  my $author_date
22
    = $git->parse_date($commit->{author_epoch}, $commit->{author_tz});
cleanup
Yuki Kimoto authored on 2013-02-01
23
  my $committer_date
24
    = $git->parse_date($commit->{committer_epoch}, $commit->{committer_tz});
cleanup
Yuki Kimoto authored on 2013-01-28
25
  $commit->{author_date} = $git->timestamp($author_date);
26
  $commit->{committer_date} = $git->timestamp($committer_date);
cleanup
Yuki Kimoto authored on 2013-05-31
27
  $from_rev = $commit->{parent} unless defined $from_rev;
add title
Yuki Kimoto authored on 2013-06-12
28
  my $commit_short_id = substr($commit->{id}, 0, 7, );
impved merge commit logic
Yuki Kimoto authored on 2013-06-01
29
  
added branch and tag refs to...
Yuki Kimoto authored on 2013-04-26
30
  # Branches
improved commit page design
Yuki Kimoto authored on 2013-04-26
31
  my $branch_refs = $git->references($user, $project, 'heads');
added branch and tag refs to...
Yuki Kimoto authored on 2013-04-26
32
  my $branches = $branch_refs->{$commit->{id}} || [];
33
  
34
  # Tags
35
  my $tag_refs = $git->references($user, $project, 'tags');
improved commit page design
Yuki Kimoto authored on 2013-04-26
36
  my $tags = $tag_refs->{$commit->{id}} || [];
added branch and tag refs to...
Yuki Kimoto authored on 2013-04-26
37
  
cleanup
Yuki Kimoto authored on 2013-03-19
38
  # Global variable for included template
improved commit page blobdif...
Yuki Kimoto authored on 2013-02-01
39
  stash(
cleanup
Yuki Kimoto authored on 2013-05-31
40
    rev => $rev,
41
    from_rev => $from_rev,
add diff status bar to commi...
Yuki Kimoto authored on 2013-05-30
42
    commit => $commit,
43
    parents => $commit->{parents}
improved commit page blobdif...
Yuki Kimoto authored on 2013-02-01
44
  );
cleanup
Yuki Kimoto authored on 2013-01-28
45

            
improve commits page design
Yuki Kimoto authored on 2016-02-01
46
  layout 'common', title => "$commit->{title_short} \x{30fb} $commit_short_id";
47
%>
add diff status bar to commi...
Yuki Kimoto authored on 2013-05-30
48

            
improve commits page design
Yuki Kimoto authored on 2016-02-01
49
%= include '/include/header';
copy gitweblite soruce code
root authored on 2012-11-23
50

            
improve commits page design
Yuki Kimoto authored on 2016-02-01
51
<div class="container">
52
  <ul class="commits-summary">
53
    <li>
54
      <ul class="commits-summary-header">
55
        <li>
56
          <div>
fixed commit page comment bu...
Yuki Kimoto authored on 2013-04-26
57
            % if ($commit->{title_short} eq $commit->{title}) {
58
              <b><%= $commit->{title_short} %></b>;
59
            % } else {
60
              <%
61
                my $title_short = $commit->{title_short};
62
                $title_short =~ s/\.\.\.\s*$//;
63
                my $title_tail = $commit->{title};
64
                $title_tail =~ s/^\Q$title_short//;
65
                $title_tail =~ s/^\s+//;
66
              %>
improve commits page design
Yuki Kimoto authored on 2016-02-01
67
              <p><b><%= $title_short %>...</b></p>
68
              <p>...<%= $title_tail %></p>
cleanup
Yuki Kimoto authored on 2013-03-15
69
            % }
improve commits page design
Yuki Kimoto authored on 2016-02-01
70
          </div>
71

            
72
          % if (@{$commit->{comment}} > 1) {
fixed commit page comment bu...
Yuki Kimoto authored on 2013-04-26
73
            <div>
improve commits page design
Yuki Kimoto authored on 2016-02-01
74
              % for (my $i = 1; $i < @{$commit->{comment}}; $i++) {
75
                <div>
improve commit page design
Yuki Kimoto authored on 2016-02-03
76
                  % warn $commit->{comment}[$i];
improve commits page design
Yuki Kimoto authored on 2016-02-01
77
                  <%= $commit->{comment}[$i] %>
78
                </div>
79
              % }
fixed commit page comment bu...
Yuki Kimoto authored on 2013-04-26
80
            </div>
81
          % }
improve commits page design
Yuki Kimoto authored on 2016-02-01
82
          % if (@$branches || @$tags) {
improved commit page parents...
Yuki Kimoto authored on 2013-06-02
83
            <div>
improve commits page design
Yuki Kimoto authored on 2016-02-01
84
              % for my $branch (@$branches) {
85
                <i class="icon-share-alt" style="padding-right:1px"></i><a href="<%= url_for("/$user/$project/tree/$branch") %>"><%= $branch %></a>
86
              % }
improved commit page parents...
Yuki Kimoto authored on 2013-06-02
87
              
improve commits page design
Yuki Kimoto authored on 2016-02-01
88
              % for my $tag (@$tags) {
89
                <span style="padding-left:5px">
90
                  <i class="icon-tag" style="padding-right:2px"></i><a href="<%= url_for("/$user/$project/tree/$tag") %>"><%= $tag %></a>
91
                </span>
92
              % }
improved commit page parents...
Yuki Kimoto authored on 2013-06-02
93
            </div>
fixed commit page comment bu...
Yuki Kimoto authored on 2013-04-26
94
          % }
improve commits page design
Yuki Kimoto authored on 2016-02-01
95
        </li>
96
        <li class="last-child">
97
          <a class="btn btn-primary" href="<%= url_for("/$user/$project/tree/$commit->{id}") %>">
98
            Browse files
99
          </a>
100
        </li>
101
      </ul>
102
    </li>
103
    <li class="last-child">
improve commit page design
Yuki Kimoto authored on 2016-02-02
104
      <ul class="commits-summary-body">
105
        <li>
106
          <span class="commits-summary-author"><%= $commit->{author_name} %></span>
107
          <span>commited on <span title="<%= $commit->{age_string_datetime_local} %>"><%= $commit->{age_string_date_local} %></span>
108
        </li>
109
        <li class="last-child">
110
          % my $parents = $commit->{parents};
111
          
112
          % if (@$parents == 0) {
113
            <div class="commits-summary-parent">
114
              <span>0 parent</span>
115
            </div>
116
          % } elsif (@$parents == 1) {
117
            <div class="commits-summary-parent">
118
              <span>1 parent</span>
119
              <a href="<%= url_for("/$user/$project/commit/$parents->[0]") %>">
120
                <%= substr($parents->[0], 0, 7) %>
121
              </a>
122
            </div>
123
          % } else {
124
            <div class="commits-summary-parent">
125
              <span>2 parents</span>:
126
              
127
              <a class="font-black" href="<%= url_for("/$user/$project/commit/$parents->[0]") %>">
128
                <%= substr($parents->[0], 0, 7) %>
129
              </a>
130
              +
131
              <a class="font-black" href="<%= url_for("/$user/$project/commit/$parents->[1]") %>">
132
                <%= substr($parents->[1], 0, 7) %>
133
              </a>
134
            </div>
135
          % }
136
          <div class="commits-summary-commit-id">
137
            commit <span><%= $commit->{id} %></span>
improve commits page design
Yuki Kimoto authored on 2016-02-01
138
          </div>
improve commit page design
Yuki Kimoto authored on 2016-02-02
139
        </li>
140
      </ul>
improve commits page design
Yuki Kimoto authored on 2016-02-01
141
    </li>
142
  </ul>
143

            
add diff status bar to commi...
Yuki Kimoto authored on 2013-05-30
144
  %= include '/include/commit_body';
improve commits page design
Yuki Kimoto authored on 2016-02-01
145
</div>
146

            
147
%= include '/include/footer';