Countdown tweaks

Summary:
A few tweaks to hsb's Countdown implementation:

  - Allow the page to be rendered "chromeless", suitable for display on one of
the dozens of monitors everyone has laying around.
  - Show title of countdown in deletion dialog.
  - When creating a new countdown default to time(), not Dec 31, 1969.
  - Add extra "/" after editing to avoid needless redirect.
  - Tweak some page titles.
  - Show countdown author in list view.
  - Highlight tab in list view.
  - Tweak menu copy.
  - Link countdown title in list view, separate buttons into different columns
so they pick up padding.

Test Plan:
Created, edited and deleted a timer. Viewed a timer and toggled chrome mode.
Viewed timer list.

Reviewed By: hsb
Reviewers: hsb, aran, jungejason, tuomaspelkonen
CC: aran, hsb, epriestley
Differential Revision: 454
This commit is contained in:
epriestley
2011-06-13 17:35:13 -07:00
parent 8f63873d57
commit aa86cf0ed8
13 changed files with 115 additions and 41 deletions

View File

@@ -37,6 +37,15 @@ class PhabricatorCountdownViewController
require_celerity_resource('phabricator-countdown-css');
$chrome_visible = $request->getBool('chrome', true);
$chrome_link = phutil_render_tag(
'a',
array(
'href' => $request->getRequestURI()->alter('chrome', !$chrome_visible),
'class' => 'phabricator-timer-chrome-link',
),
$chrome_visible ? 'Disable Chrome' : 'Enable Chrome');
$content =
'<div class="phabricator-timer">
<h1 class="phabricator-timer-header">'.
@@ -56,8 +65,9 @@ class PhabricatorCountdownViewController
<td id="phabricator-timer-minutes"></td>
<td id="phabricator-timer-seconds"></td>
</table>
</div>
</div>';
</div>'.
$chrome_link.
'</div>';
Javelin::initBehavior('countdown-timer', array(
'timestamp' => $timer->getDatepoint()
@@ -65,10 +75,12 @@ class PhabricatorCountdownViewController
$panel = $content;
return $this->buildStandardPageResponse($panel,
return $this->buildStandardPageResponse(
$panel,
array(
'title' => 'T-minus..',
'title' => 'Countdown: '.$timer->getTitle(),
'tab' => 'view',
'chrome' => $chrome_visible
));
}