| ... | ... |
@@ -35,6 +35,30 @@ |
| 35 | 35 |
box-sizing: border-box; |
| 36 | 36 |
} |
| 37 | 37 |
|
| 38 |
+.compare-open-pull-request {
|
|
| 39 |
+ border:1px solid #d8d8d8; |
|
| 40 |
+ border-radius: 3px; |
|
| 41 |
+ width:80%; |
|
| 42 |
+} |
|
| 43 |
+.compare-open-pull-request-title {
|
|
| 44 |
+ border-bottom:1px solid #d8d8d8; |
|
| 45 |
+ padding:10px; |
|
| 46 |
+} |
|
| 47 |
+.compare-open-pull-request-message {
|
|
| 48 |
+ padding:10px; |
|
| 49 |
+} |
|
| 50 |
+.compare-open-pull-request [type=text] {
|
|
| 51 |
+ width:100%; |
|
| 52 |
+} |
|
| 53 |
+.compare-open-pull-request textarea {
|
|
| 54 |
+ width:100%; |
|
| 55 |
+ min-height:200px; |
|
| 56 |
+} |
|
| 57 |
+.compare-open-pull-request-button {
|
|
| 58 |
+ padding:10px; |
|
| 59 |
+ text-align:right; |
|
| 60 |
+} |
|
| 61 |
+ |
|
| 38 | 62 |
.compare-nothing {
|
| 39 | 63 |
border:1px solid #d8d8d8; |
| 40 | 64 |
border-radius: 3px; |
| ... | ... |
@@ -8,6 +8,7 @@ |
| 8 | 8 |
my $from_rev = param('rev1');
|
| 9 | 9 |
my $rev = param('rev2');
|
| 10 | 10 |
my $page = param('page') || 0;
|
| 11 |
+ my $expand = param('expand');
|
|
| 11 | 12 |
|
| 12 | 13 |
unless ($from_rev) {
|
| 13 | 14 |
$from_rev = app->manager->default_branch($user, $project); |
| ... | ... |
@@ -49,7 +50,13 @@ |
| 49 | 50 |
stash from_id => $start_commit->{id};
|
| 50 | 51 |
stash rev => $end_commit->{id};
|
| 51 | 52 |
stash from_rev => $start_commit->{id};
|
| 52 |
- |
|
| 53 |
+ |
|
| 54 |
+ # Can open pull request |
|
| 55 |
+ my $can_open_pull_request; |
|
| 56 |
+ if (keys %$commits_date && $expand) {
|
|
| 57 |
+ $can_open_pull_request = 1; |
|
| 58 |
+ } |
|
| 59 |
+ |
|
| 53 | 60 |
layout 'common', title => "Comparing $from_rev...$rev \x{30fb} $user/$project";
|
| 54 | 61 |
%> |
| 55 | 62 |
|
| ... | ... |
@@ -98,7 +105,13 @@ |
| 98 | 105 |
%= include '/include/header'; |
| 99 | 106 |
|
| 100 | 107 |
<div class="container"> |
| 101 |
- <div class="topic1">Comparing changes</div> |
|
| 108 |
+ <div class="topic1"> |
|
| 109 |
+ % if ($can_open_pull_request) {
|
|
| 110 |
+ Open a pull request |
|
| 111 |
+ % } else {
|
|
| 112 |
+ Comparing changes |
|
| 113 |
+ % } |
|
| 114 |
+ </div> |
|
| 102 | 115 |
<div class="compare-select"> |
| 103 | 116 |
<div> |
| 104 | 117 |
<div> |
| ... | ... |
@@ -168,6 +181,22 @@ |
| 168 | 181 |
</div> |
| 169 | 182 |
</div> |
| 170 | 183 |
</div> |
| 184 |
+ |
|
| 185 |
+ % if ($can_open_pull_request) {
|
|
| 186 |
+ <div class="compare-open-pull-request"> |
|
| 187 |
+ <form> |
|
| 188 |
+ <div class="compare-open-pull-request-title"> |
|
| 189 |
+ <%= text_field 'title' %> |
|
| 190 |
+ </div> |
|
| 191 |
+ <div class="compare-open-pull-request-message"> |
|
| 192 |
+ <%= text_area 'message' %> |
|
| 193 |
+ </div> |
|
| 194 |
+ <div class="compare-open-pull-request-button"> |
|
| 195 |
+ <%= submit_button 'Create pull request', class => 'btn btn-success' %> |
|
| 196 |
+ </div> |
|
| 197 |
+ </form> |
|
| 198 |
+ </div> |
|
| 199 |
+ % } |
|
| 171 | 200 |
|
| 172 | 201 |
% if (keys %$commits_date) {
|
| 173 | 202 |
<ul class="compare-header"> |