... | ... |
@@ -82,9 +82,13 @@ |
82 | 82 |
<% |
83 | 83 |
$self->res->headers->content_type('application/atom+xml;charset=UTF-8'); |
84 | 84 |
# Create atom feed |
85 |
+ my $commit_title = $commit->{title}; |
|
86 |
+ $commit_title = Mojo::Util::xml_escape |
|
87 |
+ |
|
85 | 88 |
my $alternate_url = url_with; |
86 | 89 |
my $alternate_url_path_parts = $alternate_url->path->parts; |
87 | 90 |
$alternate_url_path_parts->[-1] =~ s/\.atom$//; |
91 |
+ |
|
88 | 92 |
#%> |
89 | 93 |
<?xml version="1.0" encoding="UTF-8" ?> |
90 | 94 |
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xml:lang="en-US"> |
... | ... |
@@ -95,16 +99,18 @@ |
95 | 99 |
<updated><%= $commits->[0]->{updated} %></updated> |
96 | 100 |
|
97 | 101 |
% for my $commit (@$commits) { |
102 |
+ % my $entry_alternate_url = url_for("/$user/$project/commit/$commit->{id}"); |
|
103 |
+ % my $author_url = url_for("/$user"); |
|
98 | 104 |
<entry> |
99 | 105 |
<id>tag:gitprep,2008:Grit::Commit/<%= $commit->{id} %></id> |
100 |
- <link type="text/html" rel="alternate" href="<%= url_for("/$user/$project/commit/$commit->{id}")->to_abs %>" /> |
|
106 |
+ <link type="text/html" rel="alternate" href="<%= $entry_alternate_url->to_abs %>" /> |
|
101 | 107 |
<title> |
102 | 108 |
<%= $commit->{title} %> |
103 | 109 |
</title> |
104 | 110 |
<updated><%= $commit->{updated} %></updated> |
105 | 111 |
<author> |
106 | 112 |
<name><%= $user %></name> |
107 |
- <uri><%= url_for("/$user")->to_abs %></uri> |
|
113 |
+ <uri><%= $author_url->to_abs %></uri> |
|
108 | 114 |
</author> |
109 | 115 |
<content type="html"> |
110 | 116 |
<%= "<pre style='white-space:pre-wrap;width:81ex'>$commit->{title}</pre>" %> |
... | ... |
@@ -24,89 +24,52 @@ |
24 | 24 |
$rep->{private} = $project->{private}; |
25 | 25 |
push @$reps, $rep; |
26 | 26 |
} |
27 |
-#%> |
|
28 |
-% if ($render_atom_feed) { |
|
29 |
-<% |
|
30 |
- $self->res->headers->content_type('application/atom+xml;charset=UTF-8'); |
|
31 |
- my $alternate_url = url_with; |
|
32 |
- my $alternate_url_path_parts = $alternate_url->path->parts; |
|
33 |
- $alternate_url_path_parts->[-1] =~ s/\.atom$//; |
|
34 |
-#%> |
|
35 |
-<?xml version="1.0" encoding="UTF-8" ?> |
|
36 |
-<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xml:lang="en-US"> |
|
37 |
- <id>tag:gitprep,2008:/<%= $user %></id> |
|
38 |
- <link type="text/html" rel="alternate" href="<%= $alternate_url->to_abs %>"/> |
|
39 |
- <link type="application/atom+xml" rel="self" href="<%= url_with->to_abs %>"/> |
|
40 |
- <title>Recent Commits to <%= "$project:$rev" %></title> |
|
41 |
- <updated><%= $commits->[0]->{updated} %></updated> |
|
42 |
- |
|
43 |
- % for my $commit (@$commits) { |
|
44 |
- % my $entry_alternate_url = url_for("/$user/$project/commit/$commit->{id}"); |
|
45 |
- % my $author_url = url_for("/$user"); |
|
46 |
- <entry> |
|
47 |
- <id>tag:gitprep,2008:Grit::Commit/<%= $commit->{id} %></id> |
|
48 |
- <link type="text/html" rel="alternate" href="<%= $entry_alternate_url->to_abs %>" /> |
|
49 |
- <title> |
|
50 |
- <%= $commit->{title} %> |
|
51 |
- </title> |
|
52 |
- <updated><%= $commit->{updated} %></updated> |
|
53 |
- <author> |
|
54 |
- <name><%= $user %></name> |
|
55 |
- <uri><%= $author_url->to_abs %></uri> |
|
56 |
- </author> |
|
57 |
- <content type="html"> |
|
58 |
- <%= "<pre style='white-space:pre-wrap;width:81ex'>$commit->{title}</pre>" %> |
|
59 |
- </content> |
|
60 |
- </entry> |
|
61 |
- % } |
|
62 |
-</feed> |
|
63 |
-% } else { |
|
27 |
+%> |
|
64 | 28 |
|
65 |
- % layout 'common', title => $user; |
|
66 |
- %= include '/include/header', title => 'Repositories'; |
|
29 |
+% layout 'common', title => $user; |
|
30 |
+ %= include '/include/header', title => 'Repositories'; |
|
67 | 31 |
|
68 |
- <div class="container"> |
|
69 |
- <div> |
|
70 |
- %= include '/include/message', message => flash('message'); |
|
71 |
- |
|
72 |
- <ul class="breadcrumb" style="margin-top:10px"> |
|
73 |
- <li><a href="<%= url_for('/') %>"><i class="icon-home"></i></a></li> |
|
74 |
- / |
|
75 |
- <li><a href="<%= url_for("/$user") %>"><%= $user %></a></li> |
|
76 |
- </ul> |
|
32 |
+ <div class="container"> |
|
33 |
+ <div> |
|
34 |
+ %= include '/include/message', message => flash('message'); |
|
35 |
+ |
|
36 |
+ <ul class="breadcrumb" style="margin-top:10px"> |
|
37 |
+ <li><a href="<%= url_for('/') %>"><i class="icon-home"></i></a></li> |
|
38 |
+ / |
|
39 |
+ <li><a href="<%= url_for("/$user") %>"><%= $user %></a></li> |
|
40 |
+ </ul> |
|
77 | 41 |
|
78 |
- <h3>Repositories</h3> |
|
79 |
- |
|
80 |
- <table class="table"> |
|
81 |
- % for my $rep (sort { $a->{age} <=> $b->{age} } @$reps) { |
|
82 |
- % if (!$rep->{private} || $api->can_access_private_project($user, $rep->{name})) { |
|
83 |
- <tr> |
|
84 |
- % my $pname = $rep->{name}; |
|
85 |
- <td> |
|
86 |
- <a href="<%= url_for("/$user/$pname") %>"> |
|
87 |
- <%= $rep->{name} %> |
|
88 |
- % if ($rep->{private}) { |
|
89 |
- <i class="icon icon-lock" style="margin-left:5px;margin-right:5px"></i> |
|
90 |
- % } |
|
91 |
- </a> |
|
92 |
- </td> |
|
93 |
- <td> |
|
94 |
- <%= $rep->{description} %> |
|
95 |
- </td> |
|
96 |
- % my $age = $rep->{age_string}; |
|
97 |
- <td class="muted"> |
|
98 |
- % if ($rep->{none}) { |
|
99 |
- <span style="color:red">Repository not exists</span> |
|
100 |
- <a href="<%= "/$user/$rep->{name}/settings" %>" class="btn btn-mini">Settings</a> |
|
101 |
- % } else { |
|
102 |
- <%= $age ? "last updated $age" : 'new repository' %> |
|
42 |
+ <h3>Repositories</h3> |
|
43 |
+ |
|
44 |
+ <table class="table"> |
|
45 |
+ % for my $rep (sort { $a->{age} <=> $b->{age} } @$reps) { |
|
46 |
+ % if (!$rep->{private} || $api->can_access_private_project($user, $rep->{name})) { |
|
47 |
+ <tr> |
|
48 |
+ % my $pname = $rep->{name}; |
|
49 |
+ <td> |
|
50 |
+ <a href="<%= url_for("/$user/$pname") %>"> |
|
51 |
+ <%= $rep->{name} %> |
|
52 |
+ % if ($rep->{private}) { |
|
53 |
+ <i class="icon icon-lock" style="margin-left:5px;margin-right:5px"></i> |
|
103 | 54 |
% } |
104 |
- </td> |
|
105 |
- </tr> |
|
106 |
- % } |
|
55 |
+ </a> |
|
56 |
+ </td> |
|
57 |
+ <td> |
|
58 |
+ <%= $rep->{description} %> |
|
59 |
+ </td> |
|
60 |
+ % my $age = $rep->{age_string}; |
|
61 |
+ <td class="muted"> |
|
62 |
+ % if ($rep->{none}) { |
|
63 |
+ <span style="color:red">Repository not exists</span> |
|
64 |
+ <a href="<%= "/$user/$rep->{name}/settings" %>" class="btn btn-mini">Settings</a> |
|
65 |
+ % } else { |
|
66 |
+ <%= $age ? "last updated $age" : 'new repository' %> |
|
67 |
+ % } |
|
68 |
+ </td> |
|
69 |
+ </tr> |
|
107 | 70 |
% } |
108 |
- </table> |
|
109 |
- </div> |
|
71 |
+ % } |
|
72 |
+ </table> |
|
110 | 73 |
</div> |
111 |
- %= include '/include/footer'; |
|
112 |
-% } |
|
74 |
+ </div> |
|
75 |
+ %= include '/include/footer'; |