@@ -27,7 +27,6 @@ public function handleRequest(AphrontRequest $request) {
27
27
$ crumbs ->setBorder (true );
28
28
29
29
$ header = $ this ->buildHeaderView ($ repository );
30
- $ property_table = $ this ->buildPropertiesTable ($ repository );
31
30
$ actions = $ this ->buildActionList ($ repository );
32
31
$ description = $ this ->buildDescriptionView ($ repository );
33
32
$ locate_file = $ this ->buildLocateFile ();
@@ -90,12 +89,28 @@ public function handleRequest(AphrontRequest $request) {
90
89
91
90
$ tabs = $ this ->buildTabsView ('home ' );
92
91
92
+ $ clone_uri = $ drequest ->generateURI (
93
+ array (
94
+ 'action ' => 'clone ' ,
95
+ ));
96
+
97
+ $ clone_button = id (new PHUIButtonView ())
98
+ ->setTag ('a ' )
99
+ ->setText ('Clone ' )
100
+ ->setColor (PHUIButtonView::GREEN )
101
+ ->setIcon ('fa-download ' )
102
+ ->setWorkflow (true )
103
+ ->setHref ($ clone_uri );
104
+
105
+ $ bar = id (new PHUILeftRightView ())
106
+ ->setLeft ($ locate_file )
107
+ ->setRight ($ clone_button );
108
+
93
109
$ view = id (new PHUITwoColumnView ())
94
110
->setHeader ($ header )
95
111
->setTabs ($ tabs )
96
112
->setFooter (array (
97
- $ locate_file ,
98
- $ property_table ,
113
+ $ bar ,
99
114
$ description ,
100
115
$ content ,
101
116
));
@@ -302,87 +317,6 @@ private function buildDescriptionView(PhabricatorRepository $repository) {
302
317
return null ;
303
318
}
304
319
305
- private function buildPropertiesTable (PhabricatorRepository $ repository ) {
306
- $ viewer = $ this ->getViewer ();
307
-
308
- $ view = id (new PHUIPropertyListView ())
309
- ->setUser ($ viewer );
310
-
311
- $ display_never = PhabricatorRepositoryURI::DISPLAY_NEVER ;
312
-
313
- $ uris = $ repository ->getURIs ();
314
- foreach ($ uris as $ uri ) {
315
- if ($ uri ->getIsDisabled ()) {
316
- continue ;
317
- }
318
-
319
- if ($ uri ->getEffectiveDisplayType () == $ display_never ) {
320
- continue ;
321
- }
322
-
323
- if ($ repository ->isSVN ()) {
324
- $ label = phutil_tag_div ('diffusion-clone-label ' , pht ('Checkout ' ));
325
- } else {
326
- $ label = phutil_tag_div ('diffusion-clone-label ' , pht ('Clone ' ));
327
- }
328
-
329
- $ view ->addProperty (
330
- $ label ,
331
- $ this ->renderCloneURI ($ repository , $ uri ));
332
- }
333
-
334
- if (!$ view ->hasAnyProperties ()) {
335
- $ view = id (new PHUIInfoView ())
336
- ->setSeverity (PHUIInfoView::SEVERITY_NOTICE )
337
- ->appendChild (pht ('Repository has no URIs set. ' ));
338
- }
339
-
340
- $ box = id (new PHUIObjectBoxView ())
341
- ->setHeaderText (pht ('Details ' ))
342
- ->setBackground (PHUIObjectBoxView::BLUE_PROPERTY )
343
- ->appendChild ($ view );
344
-
345
- $ info = null ;
346
- $ drequest = $ this ->getDiffusionRequest ();
347
-
348
- // Try to load alternatives. This may fail for repositories which have not
349
- // cloned yet. If it does, just ignore it and continue.
350
- try {
351
- $ alternatives = $ drequest ->getRefAlternatives ();
352
- } catch (ConduitClientException $ ex ) {
353
- $ alternatives = array ();
354
- }
355
-
356
- if ($ alternatives ) {
357
- $ message = array (
358
- pht (
359
- 'The ref "%s" is ambiguous in this repository. ' ,
360
- $ drequest ->getBranch ()),
361
- ' ' ,
362
- phutil_tag (
363
- 'a ' ,
364
- array (
365
- 'href ' => $ drequest ->generateURI (
366
- array (
367
- 'action ' => 'refs ' ,
368
- )),
369
- ),
370
- pht ('View Alternatives ' )),
371
- );
372
-
373
- $ messages = array ($ message );
374
-
375
- $ info = id (new PHUIInfoView ())
376
- ->setSeverity (PHUIInfoView::SEVERITY_WARNING )
377
- ->setErrors (array ($ message ));
378
-
379
- $ box ->setInfoView ($ info );
380
- }
381
-
382
-
383
- return $ box ;
384
- }
385
-
386
320
private function buildHistoryTable (
387
321
$ history_results ,
388
322
$ history ,
@@ -504,52 +438,13 @@ private function buildBrowseTable(
504
438
}
505
439
506
440
$ browse_uri = $ drequest ->generateURI (array ('action ' => 'browse ' ));
507
-
508
- $ browse_panel = id (new PHUIObjectBoxView ())
509
- ->setBackground (PHUIObjectBoxView::BLUE_PROPERTY );
510
- $ header = id (new PHUIHeaderView ())
511
- ->setHeader ($ repository ->getName ());
512
-
513
- $ button = id (new PHUIButtonView ())
514
- ->setText (pht ('Browse ' ))
515
- ->setTag ('a ' )
516
- ->setIcon ('fa-code ' )
517
- ->setHref ($ browse_uri );
518
-
519
- $ header ->addActionLink ($ button );
520
- $ browse_panel ->setHeader ($ header );
521
- $ browse_panel ->setTable ($ browse_table );
522
-
523
441
$ pager ->setURI ($ browse_uri , 'offset ' );
524
442
525
- if ($ pager ->willShowPagingControls ()) {
526
- $ browse_panel ->setPager ($ pager );
527
- }
528
-
529
- return $ browse_panel ;
530
- }
531
-
532
- private function renderCloneURI (
533
- PhabricatorRepository $ repository ,
534
- PhabricatorRepositoryURI $ uri ) {
535
-
536
- if ($ repository ->isSVN ()) {
537
- $ display = csprintf (
538
- 'svn checkout %R %R ' ,
539
- (string )$ uri ->getDisplayURI (),
540
- $ repository ->getCloneName ());
541
- } else {
542
- $ display = csprintf ('%R ' , (string )$ uri ->getDisplayURI ());
543
- }
544
-
545
- $ display = (string )$ display ;
546
- $ viewer = $ this ->getViewer ();
547
-
548
- return id (new DiffusionCloneURIView ())
549
- ->setViewer ($ viewer )
550
- ->setRepository ($ repository )
551
- ->setRepositoryURI ($ uri )
552
- ->setDisplayURI ($ display );
443
+ return id (new PHUIObjectBoxView ())
444
+ ->setHeaderText ($ repository ->getName ())
445
+ ->setBackground (PHUIObjectBoxView::BLUE_PROPERTY )
446
+ ->setTable ($ browse_table )
447
+ ->setPager ($ pager );
553
448
}
554
449
555
450
private function getTagLimit () {
0 commit comments