gitprep / templates / commit.html.ep /
Newer Older
157 lines | 5.079kb
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, );
add user page link from user...
Yuki Kimoto authored on 2016-04-11
29
  my $commit_author_mail = $commit->{author_email};
30
  my $commit_author_id = app->dbi->model('user')->select(
31
    'id',
32
    where => {mail => $commit_author_mail}
33
  )->value;
impved merge commit logic
Yuki Kimoto authored on 2013-06-01
34
  
added branch and tag refs to...
Yuki Kimoto authored on 2013-04-26
35
  # Branches
cleanup tags
Yuki Kimoto authored on 2016-04-16
36
  my $branch_refs = $git->references(app->rep_info($user, $project), 'heads');
added branch and tag refs to...
Yuki Kimoto authored on 2013-04-26
37
  my $branches = $branch_refs->{$commit->{id}} || [];
38
  
39
  # Tags
cleanup tags
Yuki Kimoto authored on 2016-04-16
40
  my $tag_refs = $git->references(app->rep_info($user, $project), 'tags');
improved commit page design
Yuki Kimoto authored on 2013-04-26
41
  my $tags = $tag_refs->{$commit->{id}} || [];
added branch and tag refs to...
Yuki Kimoto authored on 2013-04-26
42
  
cleanup
Yuki Kimoto authored on 2013-03-19
43
  # Global variable for included template
improved commit page blobdif...
Yuki Kimoto authored on 2013-02-01
44
  stash(
cleanup
Yuki Kimoto authored on 2013-05-31
45
    rev => $rev,
46
    from_rev => $from_rev,
add diff status bar to commi...
Yuki Kimoto authored on 2013-05-30
47
    commit => $commit,
48
    parents => $commit->{parents}
improved commit page blobdif...
Yuki Kimoto authored on 2013-02-01
49
  );
cleanup
Yuki Kimoto authored on 2013-01-28
50

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

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

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

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

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

            
157
%= include '/include/footer';