... | ... |
@@ -58,7 +58,9 @@ |
58 | 58 |
<!-- Blame page --> |
59 | 59 |
<div class="container"> |
60 | 60 |
%= include '/include/project_header'; |
61 |
- %= include '/include/branch_select', display => 'files'; |
|
61 |
+ <div style="margin-bottom:20px;"> |
|
62 |
+ %= include '/include/branch_select', display => 'files'; |
|
63 |
+ </div> |
|
62 | 64 |
%= include '/include/page_path', type => 'blob', Path => $file; |
63 | 65 |
<div class="text-right" style="margin-bottom:10px"> |
64 | 66 |
Newer |
... | ... |
@@ -45,7 +45,9 @@ |
45 | 45 |
|
46 | 46 |
<div class="container"> |
47 | 47 |
%= include '/include/project_header'; |
48 |
- %= include '/include/branch_select', display => 'files'; |
|
48 |
+ <div style="margin-bottom:20px;"> |
|
49 |
+ %= include '/include/branch_select', display => 'files'; |
|
50 |
+ </div> |
|
49 | 51 |
%= include '/include/page_path', type => 'blob', Path => $file; |
50 | 52 |
|
51 | 53 |
<div class="border-gray" style="margin-bottom:20px"> |
... | ... |
@@ -50,7 +50,9 @@ |
50 | 50 |
|
51 | 51 |
<div class="container"> |
52 | 52 |
%= include '/include/project_header'; |
53 |
- %= include '/include/branch_select', display => 'commits'; |
|
53 |
+ <div style="margin-bottom:20px;"> |
|
54 |
+ %= include '/include/branch_select', display => 'commits'; |
|
55 |
+ </div> |
|
54 | 56 |
|
55 | 57 |
<div class="bk-blue-light border-gray" style="border-bottom:none;padding:10px;border-top-left-radius:5px;border-top-right-radius:5px"> |
56 | 58 |
<div class="row"> |
... | ... |
@@ -119,7 +119,9 @@ |
119 | 119 |
|
120 | 120 |
<div class="container"> |
121 | 121 |
%= include '/include/project_header'; |
122 |
- %= include '/include/branch_select', display => 'commits'; |
|
122 |
+ <div style="margin-bottom:20px;"> |
|
123 |
+ %= include '/include/branch_select', display => 'commits'; |
|
124 |
+ </div> |
|
123 | 125 |
|
124 | 126 |
% for my $date (reverse sort keys %$commits_date) { |
125 | 127 |
<div style="margin-bottom:20px"> |
... | ... |
@@ -96,7 +96,9 @@ |
96 | 96 |
|
97 | 97 |
<div class="container"> |
98 | 98 |
%= include '/include/project_header'; |
99 |
- %= include '/include/branch_select', display => 'files'; |
|
99 |
+ <div style="margin-bottom:20px;"> |
|
100 |
+ %= include '/include/branch_select', display => 'files'; |
|
101 |
+ </div> |
|
100 | 102 |
|
101 | 103 |
<h2>Compare View</h2> |
102 | 104 |
<div class="well" style="padding:9px 10px 9px 10px;margin-bottom:5px;position:relative"> |
... | ... |
@@ -1,8 +1,13 @@ |
1 | 1 |
<% |
2 |
+ my $api = gitprep_api; |
|
3 |
+ |
|
2 | 4 |
my $display = stash('display') || ''; |
3 | 5 |
my $rev = stash('rev'); |
4 | 6 |
$rev = '' unless defined $rev; |
5 | 7 |
my $branches = stash('branches'); |
8 |
+ my $project_page = stash('project_page'); |
|
9 |
+ |
|
10 |
+ my $logined = $api->logined; |
|
6 | 11 |
%> |
7 | 12 |
|
8 | 13 |
%= javascript begin |
... | ... |
@@ -50,7 +55,7 @@ |
50 | 55 |
} |
51 | 56 |
$('#rev-popup') |
52 | 57 |
.css('display', 'block') |
53 |
- .css('top', '40px') |
|
58 |
+ .css('top', '5px') |
|
54 | 59 |
.css('left', '0px') |
55 | 60 |
; |
56 | 61 |
}); |
... | ... |
@@ -59,7 +64,7 @@ |
59 | 64 |
else { |
60 | 65 |
$('#rev-popup') |
61 | 66 |
.css('display', 'block') |
62 |
- .css('top', '40px') |
|
67 |
+ .css('top', '5px') |
|
63 | 68 |
.css('left', '0px') |
64 | 69 |
; |
65 | 70 |
} |
... | ... |
@@ -77,7 +82,7 @@ |
77 | 82 |
$('#rev-btn').on('click', function () { |
78 | 83 |
$('#rev-popup') |
79 | 84 |
.css('display', 'block') |
80 |
- .css('top', '40px') |
|
85 |
+ .css('top', '5px') |
|
81 | 86 |
.css('left', '0px') |
82 | 87 |
; |
83 | 88 |
$('#rev-close').on('click', function () { |
... | ... |
@@ -89,28 +94,45 @@ |
89 | 94 |
% end |
90 | 95 |
|
91 | 96 |
|
92 |
- |
|
93 |
-<div style="position:relative"> |
|
94 |
- <div style="margin-bottom:20px"> |
|
95 |
- % if ($display eq 'files' || $display eq 'commits' || $display eq 'branches') { |
|
96 |
- <% |
|
97 |
- my $title; |
|
98 |
- my $rev_short; |
|
99 |
- if (defined $rev && length $rev == 40) { |
|
100 |
- $title = 'tree'; |
|
101 |
- $rev_short = substr($rev, 0, 10); |
|
102 |
- } |
|
103 |
- else { |
|
104 |
- $title = 'branch'; |
|
105 |
- $rev_short = $rev; |
|
106 |
- } |
|
107 |
- %> |
|
108 |
- <button id="rev-btn" class="btn" style="font-size:13px;padding:2px 10px;margin-top:5px;margin-right:6px"> |
|
97 |
+<div class="row"> |
|
98 |
+ % if ($display eq 'files' || $display eq 'commits' || $display eq 'branches') { |
|
99 |
+ <% |
|
100 |
+ my $title; |
|
101 |
+ my $rev_short; |
|
102 |
+ if (defined $rev && length $rev == 40) { |
|
103 |
+ $title = 'tree'; |
|
104 |
+ $rev_short = substr($rev, 0, 10); |
|
105 |
+ } |
|
106 |
+ else { |
|
107 |
+ $title = 'branch'; |
|
108 |
+ $rev_short = $rev; |
|
109 |
+ } |
|
110 |
+ %> |
|
111 |
+ <div class="span2"> |
|
112 |
+ <button id="rev-btn" class="btn" style="font-size:13px;padding:2px 10px;margin-right:6px"> |
|
109 | 113 |
<i class="icon-share-alt"></i><span class="muted"><%= $title %>:</span> <b><%= $rev_short %></b> |
110 | 114 |
</button> |
111 |
- % } |
|
112 |
- </div> |
|
113 |
- |
|
115 |
+ </div> |
|
116 |
+ % } |
|
117 |
+ % if ($project_page) { |
|
118 |
+ <div class="span10" style="text-algin:right;overflow:hidden"> |
|
119 |
+ <a class="btn" style="margin-left:5px;float:right;font-size:12px;font-weight:bold;color:#333;padding:3px 6px" href="<%= url_for("/$user/$project/archive/$rev.zip") %>"> |
|
120 |
+ Download ZIP |
|
121 |
+ </a> |
|
122 |
+ <div class="input-append" style="float:right"> |
|
123 |
+ <div class="btn-group" data-toggle="buttons-radio"> |
|
124 |
+ <button class="btn" id="btn_http" style="margin-left:5px;padding:3px 6px;border-top-right-radius:0px; border-bottom-right-radius:0px"><%= $self->req->is_secure ? 'HTTPS' : 'HTTP' %></button> |
|
125 |
+ % if ($logined) { |
|
126 |
+ <button class="btn" id="btn_ssh" style="padding:3px 7px;border-radius:0">SSH</button> |
|
127 |
+ % } |
|
128 |
+ </div> |
|
129 |
+ <input id="rep_url" type="text" style="width:550px;border-radius:0;padding:3px 7px;border-top-right-radius:3px;border-bottom-right-radius:3px"> |
|
130 |
+ </div> |
|
131 |
+ </div> |
|
132 |
+ % } |
|
133 |
+</div> |
|
134 |
+ |
|
135 |
+<div style="position:relative"> |
|
114 | 136 |
% if ($display eq 'files' || $display eq 'commits') { |
115 | 137 |
<div id="rev-popup" style="display:none;width:330px;position:absolute"> |
116 | 138 |
<div class="radius-top border-gray" style="background:#E6E6FA;padding:10px"> |
... | ... |
@@ -164,5 +186,4 @@ |
164 | 186 |
</ul> |
165 | 187 |
</div> |
166 | 188 |
% } |
167 |
- |
|
168 | 189 |
</div> |
... | ... |
@@ -1,199 +0,0 @@ |
1 |
-<% |
|
2 |
- my $display = stash('display') || ''; |
|
3 |
- my $rev = stash('rev'); |
|
4 |
- $rev = '' unless defined $rev; |
|
5 |
- my $branches = stash('branches'); |
|
6 |
- my $branches_count = app->git->branches_count($user, $project); |
|
7 |
- my $default_branch_name = app->manager->default_branch($user, $project); |
|
8 |
- my $tags_count = app->git->tags_count($user, $project); |
|
9 |
-%> |
|
10 |
- |
|
11 |
-%= javascript begin |
|
12 |
- $(document).ready(function () { |
|
13 |
- |
|
14 |
- % if ($display eq 'files' || $display eq 'commits') { |
|
15 |
- % my $type = $display eq 'files' ? 'tree' : 'commits'; |
|
16 |
- |
|
17 |
- // Switch branches and tags |
|
18 |
- var revs_init = false; |
|
19 |
- $('#rev-btn').on('click', function () { |
|
20 |
- |
|
21 |
- if (!revs_init) { |
|
22 |
- $.get('<%= url_for("/$user/$project/api/revs") %>', function (result) { |
|
23 |
- var branch_names = result.branch_names; |
|
24 |
- var tag_names = result.tag_names; |
|
25 |
- var style = 'style="border-top-left-radius:0px;border-top-right-radius:0px;"'; |
|
26 |
- |
|
27 |
- if (branch_names.length === 0) { |
|
28 |
- $('#branch-names-list').append( |
|
29 |
- '<li><a ' + style + ' href="#">No branches</a></li>' |
|
30 |
- ); |
|
31 |
- } |
|
32 |
- else { |
|
33 |
- for (var i = 0; i < branch_names.length; i++) { |
|
34 |
- var branch_name = branch_names[i]; |
|
35 |
- $('#branch-names-list').append( |
|
36 |
- '<li><a ' + style + ' href="<%= url_for("/$user/$project/$type/") %>' + branch_name + '">' + branch_name + '</a></li>' |
|
37 |
- ); |
|
38 |
- } |
|
39 |
- } |
|
40 |
- |
|
41 |
- if (tag_names.length === 0) { |
|
42 |
- $('#tag-names-list').append( |
|
43 |
- '<li><a ' + style + ' href="#">No tags</a></li>' |
|
44 |
- ); |
|
45 |
- } |
|
46 |
- else { |
|
47 |
- for (var i = 0; i < tag_names.length; i++) { |
|
48 |
- var tag_name = tag_names[i]; |
|
49 |
- $('#tag-names-list').append( |
|
50 |
- '<li><a ' + style + ' href="<%= url_for("/$user/$project/$type/") %>' + tag_name + '">' + tag_name + '</a></li>' |
|
51 |
- ); |
|
52 |
- } |
|
53 |
- } |
|
54 |
- $('#rev-popup') |
|
55 |
- .css('display', 'block') |
|
56 |
- .css('top', '40px') |
|
57 |
- .css('left', '0px') |
|
58 |
- ; |
|
59 |
- }); |
|
60 |
- revs_init = true; |
|
61 |
- } |
|
62 |
- else { |
|
63 |
- $('#rev-popup') |
|
64 |
- .css('display', 'block') |
|
65 |
- .css('top', '40px') |
|
66 |
- .css('left', '0px') |
|
67 |
- ; |
|
68 |
- } |
|
69 |
- }); |
|
70 |
- |
|
71 |
- $('#revs-tab a').click(function (e) { |
|
72 |
- e.preventDefault(); |
|
73 |
- $(this).tab('show'); |
|
74 |
- }) |
|
75 |
- |
|
76 |
- $('#rev-close').on('click', function () { |
|
77 |
- $('#rev-popup').css('display', 'none'); |
|
78 |
- }); |
|
79 |
- % } elsif ($display eq 'branches') { |
|
80 |
- $('#rev-btn').on('click', function () { |
|
81 |
- $('#rev-popup') |
|
82 |
- .css('display', 'block') |
|
83 |
- .css('top', '40px') |
|
84 |
- .css('left', '0px') |
|
85 |
- ; |
|
86 |
- $('#rev-close').on('click', function () { |
|
87 |
- $('#rev-popup').css('display', 'none'); |
|
88 |
- }); |
|
89 |
- }); |
|
90 |
- % } |
|
91 |
- }); |
|
92 |
-% end |
|
93 |
- |
|
94 |
- |
|
95 |
- |
|
96 |
-<div style="position:relative"> |
|
97 |
- <ul class="nav nav-tabs" style="margin-bottom:20px"> |
|
98 |
- % if ($display eq 'files' || $display eq 'commits' || $display eq 'branches') { |
|
99 |
- <% |
|
100 |
- my $title; |
|
101 |
- my $rev_short; |
|
102 |
- if (defined $rev && length $rev == 40) { |
|
103 |
- $title = 'tree'; |
|
104 |
- $rev_short = substr($rev, 0, 10); |
|
105 |
- } |
|
106 |
- else { |
|
107 |
- $title = 'branch'; |
|
108 |
- $rev_short = $rev; |
|
109 |
- } |
|
110 |
- %> |
|
111 |
- <li style="padding-right:10px"> |
|
112 |
- <button id="rev-btn" class="btn" style="font-size:13px;padding:2px 10px;margin-top:5px;margin-right:6px"> |
|
113 |
- <i class="icon-share-alt"></i><span class="muted"><%= $title %>:</span> <b><%= $rev_short %></b> |
|
114 |
- </button> |
|
115 |
- </li> |
|
116 |
- % } |
|
117 |
- <li class="<%= $display eq 'files' ? 'active' : '' %>"> |
|
118 |
- % if ($display eq 'tags' || $rev eq $default_branch_name) { |
|
119 |
- <a href="<%= url_for("/$user/$project") %>">Files</a> |
|
120 |
- % } else { |
|
121 |
- <a href="<%= url_for("/$user/$project/tree/$rev") %>">Files</a> |
|
122 |
- % } |
|
123 |
- </li> |
|
124 |
- <li class="<%= $display eq 'commits' ? 'active' : '' %>"> |
|
125 |
- % if (length $rev) { |
|
126 |
- <a href="<%= url_for("/$user/$project/commits/$rev") %>">Commits</a> |
|
127 |
- % } else { |
|
128 |
- <a href="<%= url_for("/$user/$project/commits/$default_branch_name") %>">Commits</a> |
|
129 |
- % } |
|
130 |
- </li> |
|
131 |
- <li class="<%= $display eq 'branches' ? 'active' : '' %>"> |
|
132 |
- <a href="<%= url_for("/$user/$project/branches") %>"> |
|
133 |
- Branches |
|
134 |
- <span class="badge"><%= $branches_count %></span> |
|
135 |
- </a> |
|
136 |
- </li> |
|
137 |
- <li class="<%= $display eq 'tags' ? 'active' : '' %>"> |
|
138 |
- <a href="<%= url_for("/$user/$project/tags") %>"> |
|
139 |
- Tags |
|
140 |
- <span class="badge"><%= $tags_count > 999 ? '999+' : $tags_count %></span> |
|
141 |
- </a> |
|
142 |
- </li> |
|
143 |
- </ul> |
|
144 |
- |
|
145 |
- % if ($display eq 'files' || $display eq 'commits') { |
|
146 |
- <div id="rev-popup" style="display:none;width:330px;position:absolute"> |
|
147 |
- <div class="radius-top border-gray" style="background:#E6E6FA;padding:10px"> |
|
148 |
- <div class="row"> |
|
149 |
- <div class="span3"> |
|
150 |
- <b>Switch branches/tags</b> |
|
151 |
- </div> |
|
152 |
- <div class="text-right"> |
|
153 |
- <i id="rev-close" class="icon-remove-circle"></i> |
|
154 |
- </div> |
|
155 |
- </div> |
|
156 |
- </div> |
|
157 |
- <ul class="nav nav-tabs" id="revs-tab" style="background:#F5F5F5;margin-bottom:0"> |
|
158 |
- <li class="active"><a href="#branches">Branches</a></li> |
|
159 |
- <li><a href="#tags">Tags</a></li> |
|
160 |
- </ul> |
|
161 |
- <div class="tab-content"> |
|
162 |
- <div class="tab-pane active" id="branches" style="background:white;max-height:300px;overflow:auto;margin-top:0"> |
|
163 |
- <ul id="branch-names-list" class="nav nav-tabs nav-stacked"> |
|
164 |
- </ul> |
|
165 |
- </div> |
|
166 |
- <div class="tab-pane" id="tags" style="background:white;max-height:300px;overflow:auto;margin-top:0"> |
|
167 |
- <ul id="tag-names-list" class="nav nav-tabs nav-stacked"> |
|
168 |
- </ul> |
|
169 |
- </div> |
|
170 |
- </div> |
|
171 |
- </div> |
|
172 |
- % } else { |
|
173 |
- <div id="rev-popup" style="display:none;width:330px;position:absolute"> |
|
174 |
- <div class="radius-top border-gray" style="background:#E6E6FA;padding:10px"> |
|
175 |
- <div class="row"> |
|
176 |
- <div class="span3"> |
|
177 |
- <b>Switch branches</b> |
|
178 |
- </div> |
|
179 |
- <div class="text-right"> |
|
180 |
- <i id="rev-close" class="icon-remove-circle"></i> |
|
181 |
- </div> |
|
182 |
- </div> |
|
183 |
- </div> |
|
184 |
- <ul class="nav nav-tabs" style="background:#F5F5F5;margin-bottom:0"> |
|
185 |
- <li class="active"><a href="#branches">Branches</a></li> |
|
186 |
- </ul> |
|
187 |
- <ul id="rev-names-list" class="nav nav-tabs nav-stacked" style="background:white"> |
|
188 |
- % for my $branch (@$branches) { |
|
189 |
- <li> |
|
190 |
- <a style="border-top-left-radius:0px;border-top-right-radius:0px;" href="<%= url_for("/$user/$project/branches/$branch->{name}") %>"> |
|
191 |
- <%= $branch->{name} %> |
|
192 |
- </a> |
|
193 |
- </li> |
|
194 |
- % } |
|
195 |
- </ul> |
|
196 |
- </div> |
|
197 |
- % } |
|
198 |
- |
|
199 |
-</div> |
... | ... |
@@ -61,12 +61,12 @@ |
61 | 61 |
my $default_branch_name = app->manager->default_branch($user, $project); |
62 | 62 |
my $tags_count = app->git->tags_count($user, $project); |
63 | 63 |
my $display = 'files'; |
64 |
+ |
|
65 |
+ my $logined = $api->logined; |
|
66 |
+ |
|
67 |
+ layout 'common', title => "$user/$project"; |
|
64 | 68 |
%> |
65 | 69 |
|
66 |
-% layout 'common', title => "$user/$project"; |
|
67 |
- |
|
68 |
- % my $logined = $api->logined; |
|
69 |
- |
|
70 | 70 |
%= javascript begin |
71 | 71 |
$(document).ready(function () { |
72 | 72 |
var http_rep_url = '<%= url_for("$user/$project.git")->to_abs %>'; |
... | ... |
@@ -114,7 +114,7 @@ |
114 | 114 |
%= include '/include/message', message => flash('message'); |
115 | 115 |
%= include '/include/project_header'; |
116 | 116 |
|
117 |
- <h3 style="margin:20px 0px 20px 0;font-size:16px;line-height:0"> |
|
117 |
+ <h3 style="font-weight:normal;color:#666;margin:20px 0px 20px 0;font-size:16px;line-height:0"> |
|
118 | 118 |
<%= $desc %> |
119 | 119 |
</h3> |
120 | 120 |
% if ($state eq 'display') { |
... | ... |
@@ -137,29 +137,15 @@ |
137 | 137 |
</li> |
138 | 138 |
<li class="<%= $display eq 'tags' ? 'active' : '' %>"> |
139 | 139 |
<a href="<%= url_for("/$user/$project/tags") %>"> |
140 |
- <%= $tags_count %> tags |
|
140 |
+ <%= $tags_count %> releases |
|
141 | 141 |
</a> |
142 | 142 |
</li> |
143 | 143 |
</ul> |
144 | 144 |
|
145 |
- <div class="border-gray radius" style="padding:0 3px;margin-bottom:10px;"> |
|
146 |
- <a class="btn" style="padding:3px 6px;margin-left:10px" href="<%= url_for("/$user/$project/archive/$rev.zip") %>"> |
|
147 |
- <i class="icon-arrow-down"></i>ZIP |
|
148 |
- </a> |
|
149 |
- <div class="input-append" style="margin-top:10px"> |
|
150 |
- <div class="btn-group" data-toggle="buttons-radio"> |
|
151 |
- <button class="btn" id="btn_http" style="margin-left:5px;padding:3px 6px;border-top-right-radius:0px; border-bottom-right-radius:0px"><%= $self->req->is_secure ? 'HTTPS' : 'HTTP' %></button> |
|
152 |
- % if ($logined) { |
|
153 |
- <button class="btn" id="btn_ssh" style="padding:3px 7px;border-radius:0">SSH</button> |
|
154 |
- % } |
|
155 |
- </div> |
|
156 |
- <input id="rep_url" type="text" style="width:635px;border-radius:0;padding:3px 7px;border-top-right-radius:3px;border-bottom-right-radius:3px"> |
|
157 |
- </div> |
|
158 |
- <span style="color:#666;font-size:12px"><b><span id="access"></span></b> access</span> |
|
145 |
+ <div style="margin-bottom:5px;"> |
|
146 |
+ %= include '/include/branch_select', display => 'files', project_page => 1; |
|
159 | 147 |
</div> |
160 | 148 |
|
161 |
- %= include '/include/branch_select', display => 'files'; |
|
162 |
- |
|
163 | 149 |
<div style="margin-bottom:30px"> |
164 | 150 |
%= include '/include/tree'; |
165 | 151 |
</div> |
... | ... |
@@ -47,7 +47,9 @@ |
47 | 47 |
|
48 | 48 |
<div class="container"> |
49 | 49 |
%= include '/include/project_header'; |
50 |
- %= include '/include/branch_select', display => 'files'; |
|
50 |
+ <div style="margin-bottom:20px;"> |
|
51 |
+ %= include '/include/branch_select', display => 'files'; |
|
52 |
+ </div> |
|
51 | 53 |
%= include '/include/page_path', type => 'blob', Path => $file; |
52 | 54 |
|
53 | 55 |
<div class="border-gray bk-gray-light" style="padding:5px; border-bottom:none"> |
... | ... |
@@ -37,7 +37,9 @@ |
37 | 37 |
|
38 | 38 |
<div class="container"> |
39 | 39 |
%= include '/include/project_header'; |
40 |
- %= include '/include/branch_select', display => 'files'; |
|
40 |
+ <div style="margin-bottom:20px;"> |
|
41 |
+ %= include '/include/branch_select', display => 'files'; |
|
42 |
+ </div> |
|
41 | 43 |
%= include '/include/page_path', type => 'tree', Path => $dir; |
42 | 44 |
%= include '/include/tree'; |
43 | 45 |
|