... | ... |
@@ -590,6 +590,10 @@ ul.issues-label-pallet li { |
590 | 590 |
.pulls-description { |
591 | 591 |
color:#767676; |
592 | 592 |
} |
593 |
+.compare-desc { |
|
594 |
+ color:#767676; |
|
595 |
+ margin-bottom:10px; |
|
596 |
+} |
|
593 | 597 |
.compare-open-pull-request { |
594 | 598 |
border:1px solid #d8d8d8; |
595 | 599 |
border-radius: 3px; |
... | ... |
@@ -346,6 +346,15 @@ |
346 | 346 |
}); |
347 | 347 |
% end |
348 | 348 |
|
349 |
+%= javascript begin |
|
350 |
+ $(document).ready(function () { |
|
351 |
+ $('#comapre-across-btn').on('click', function () { |
|
352 |
+ $('#base-fork-btn').toggle(); |
|
353 |
+ $('#head-fork-btn').toggle(); |
|
354 |
+ }); |
|
355 |
+ }); |
|
356 |
+% end |
|
357 |
+ |
|
349 | 358 |
%= include '/include/header'; |
350 | 359 |
|
351 | 360 |
<div class="container"> |
... | ... |
@@ -355,33 +364,32 @@ |
355 | 364 |
% if ($can_open_pull_request) { |
356 | 365 |
Open a pull request |
357 | 366 |
% } else { |
358 |
- Comparing changes |
|
367 |
+ Compare changes |
|
359 | 368 |
% } |
360 | 369 |
</div> |
370 |
+ <div class="compare-desc"> |
|
371 |
+ Compare changes across branches, commits, tags, and more below. If you need to, you can also <a href="javascript:void(0)" id="comapre-across-btn">compare across forks</a>. |
|
372 |
+ </div> |
|
361 | 373 |
<div class="compare-select"> |
362 | 374 |
<div> |
363 | 375 |
<div> |
364 | 376 |
<div style="display:inline-block"> |
365 |
- % if ($base_user_id ne $target_user_id) { |
|
366 |
- <button id="base-fork-btn" class="btn btn-small"> |
|
367 |
- <span>base fork:</span><b> <%= $base_project->{'user.id'} %>/<%= $base_project->{id} %></b><i class="icon-arrow-down"></i> |
|
368 |
- </button> |
|
369 |
- % } |
|
377 |
+ <button id="base-fork-btn" class="btn btn-small" style="<%= $base_user_id eq $target_user_id ? 'display:none' : '' %>"> |
|
378 |
+ <span>base fork:</span><b> <%= $base_project->{'user.id'} %>/<%= $base_project->{id} %></b><i class="icon-arrow-down"></i> |
|
379 |
+ </button> |
|
370 | 380 |
<button id="base-branch-btn" class="btn btn-small"> |
371 | 381 |
<span>base:</span><b> <%= $base_branch %></b><i class="icon-arrow-down"></i> |
372 | 382 |
</button> |
373 | 383 |
... |
374 | 384 |
</div> |
375 | 385 |
<div style="display:inline-block;margin-top:10px;"> |
376 |
- % if ($base_user_id ne $target_user_id) { |
|
377 |
- <button id="head-fork-btn" class="btn btn-small"> |
|
378 |
- <span>head fork:</span><b> <%= $target_project->{'user.id'} %>/<%= $target_project->{id} %></b><i class="icon-arrow-down"></i> |
|
379 |
- </button> |
|
380 |
- % } |
|
386 |
+ <button id="head-fork-btn" class="btn btn-small" style="<%= $base_user_id eq $target_user_id ? 'display:none' : '' %>"> |
|
387 |
+ <span>head fork:</span><b> <%= $target_project->{'user.id'} %>/<%= $target_project->{id} %></b><i class="icon-arrow-down"></i> |
|
388 |
+ </button> |
|
381 | 389 |
<button id="target-branch-btn" class="btn btn-small"> |
382 | 390 |
<span>compare:</span> <b><%= $target_branch %></b><i class="icon-arrow-down"></i> |
383 | 391 |
</button> |
384 |
- |
|
392 |
+ |
|
385 | 393 |
% if ($can_open_pull_request) { |
386 | 394 |
% if ($merge_success) { |
387 | 395 |
<span style="margin-left:10px"> |