1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 03:50:54 +01:00

Use generic URIs

Summary:
/diffusion/X/history/?copies=0 is same as /diffusion/X/history/
/countdown/1/?chrome=1 is same as /countdown/1/

Test Plan:
Visit /diffusion/X/history/, click on Show/Hide Copies/Branches twice.
Visit /countdown/1/, click on Disable/Enable Chrome twice.

Reviewers: epriestley, tuomaspelkonen

Reviewed By: epriestley

CC: aran

Differential Revision: https://secure.phabricator.com/D1424
This commit is contained in:
vrana 2012-01-16 14:41:07 -08:00
parent 1651be91ec
commit c0592b55d7
2 changed files with 7 additions and 8 deletions

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -38,10 +38,11 @@ class PhabricatorCountdownViewController
require_celerity_resource('phabricator-countdown-css');
$chrome_visible = $request->getBool('chrome', true);
$chrome_new = $chrome_visible ? false : null;
$chrome_link = phutil_render_tag(
'a',
array(
'href' => $request->getRequestURI()->alter('chrome', !$chrome_visible),
'href' => $request->getRequestURI()->alter('chrome', $chrome_new),
'class' => 'phabricator-timer-chrome-link',
),
$chrome_visible ? 'Disable Chrome' : 'Enable Chrome');

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -71,19 +71,17 @@ class DiffusionHistoryController extends DiffusionController {
if ($request->getBool('copies')) {
$button_title = 'Hide Copies/Branches';
$copies_new = null;
} else {
$button_title = 'Show Copies/Branches';
$copies_new = true;
}
$button_uri = $request->getRequestURI()->alter(
'copies',
!$request->getBool('copies'));
$button = phutil_render_tag(
'a',
array(
'class' => 'button small grey',
'href' => $button_uri,
'href' => $request->getRequestURI()->alter('copies', $copies_new),
),
phutil_escape_html($button_title));