Skip to content

Commit

Permalink
Cosmetic fixes as per Anil
Browse files Browse the repository at this point in the history
  • Loading branch information
ginatrapani committed Mar 15, 2012
1 parent c88e122 commit d1c80fa
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/TestOfUpgradeApplicationController.php
Expand Up @@ -114,7 +114,7 @@ public function testAvailableFileSpace() {
}

public function testNotEnoughAvailableFileSpace() {
AppUpgraderDiskUtil::$DISK_SPACE_NEEDED = 107374182400 * 1024 * 100000 ; // a LOT of disk space
AppUpgraderDiskUtil::$DISK_SPACE_NEEDED = 107374182400 * 1024 * 10 ; // a LOT of disk space
$upgrade_controller = new UpgradeApplicationController(true);
try {
$upgrade_controller->runUpdate();
Expand Down
3 changes: 3 additions & 0 deletions webapp/_lib/controller/class.UpgradeApplicationController.php
Expand Up @@ -43,6 +43,7 @@ public function __construct($session_started=false) {
}

public function authControl() {
$show_try_again_button = false;
if (isset($_GET['run_update'])) {
try {
$backup_info = $this->runUpdate();
Expand All @@ -65,8 +66,10 @@ public function authControl() {
$this->addToView('updateable',true);
} catch(Exception $e) {
$this->addErrorMessage($e->getMessage(), null, true);
$show_try_again_button = true;
}
}
$this->addToView('show_try_again_button', $show_try_again_button);
return $this->generateView();
}

Expand Down
3 changes: 1 addition & 2 deletions webapp/_lib/model/class.AppUpgraderDiskUtil.php
Expand Up @@ -263,7 +263,6 @@ private function getInadequateFilePermissionsException() {
return "<b>Oops!</b> ThinkUp can't upgrade itself because it doesn't have the right file permissions. ".
"To fix this problem, run<br><br><code>chown -R $whoami ". THINKUP_WEBAPP_PATH."</code><br><br>".
"on your server, using root (or sudo). If you don't have root access, try the following: ".
"<br><br> <code>chmod -R a+rw ".THINKUP_WEBAPP_PATH."</code><br><br><br>".
'<div><a href="#" class="linkbutton emphasized">Okay, done. Try Again&rarr;</a></div><br><br>';
"<br><br> <code>chmod -R a+rw ".THINKUP_WEBAPP_PATH."</code><br><br>";
}
}
4 changes: 2 additions & 2 deletions webapp/_lib/view/install.checkversion.tpl
Expand Up @@ -18,11 +18,11 @@
var txt = '';
// console.debug(data);
// console.debug('version ' + data[0].version);
txt += ' | <a href="{/literal}{$site_root_path}{literal}install/upgrade-application.php">'+data[0].version+'</a>';
txt += ' <a class="linkbutton" style="background: #31C22D;color:white;" href="{/literal}{$site_root_path}{literal}install/upgrade-application.php" title="'+data[0].version+'">Upgrade ThinkUp</a>';
div.innerHTML = txt; // assign new HTML into #ROOT
div.style.display = 'inline'; // make element visible
}

document.write("<span id='" + ROOT + "' style='display: none'></span>");
requestContent();
}{/literal}
}{/literal}
10 changes: 8 additions & 2 deletions webapp/_lib/view/install.upgrade-application.tpl
Expand Up @@ -11,11 +11,17 @@

{include file="_usermessage.tpl"}

{if $show_try_again_button}
<br>
<div>
<a href="upgrade-application.php" class="linkbutton emphasized">Try Again</a></div><br><br>
</div>
{/if}
{if $updateable}
<div class="alert helpful">
<p>
<span class="ui-icon ui-icon-check" style="float: left; margin:.3em 0.3em 0 0;"></span>
Ready to upgrade {if $latest_version} to version <b>{$latest_version}</b>{/if}.
Ready to upgrade ThinkUp. {if $latest_version}Here's <a href="http://thinkupapp.com/docs/changelog/{$latest_version}.html">what's new in version <b>{$latest_version}</b></a>{/if}.
</p>
</div>
<br>
Expand All @@ -37,7 +43,7 @@
</div>
<br>
<div>
<p><a href="{$site_root_path}install/upgrade-database.php" class="linkbutton emphasized">One more thing: Upgrade ThinkUp's database&rarr;</a></p>
<p><a href="{$site_root_path}install/upgrade-database.php" class="linkbutton emphasized">Upgrade ThinkUp's database</a></p>
</div>
{/if}
</div>
Expand Down
2 changes: 1 addition & 1 deletion webapp/_lib/view/install.upgrade-database.tpl
Expand Up @@ -36,7 +36,7 @@
</div>
<br>
<div>
<p><a href="{$site_root_path}" class="linkbutton emphasized">Start using your shiny new ThinkUp&rarr;</a></p>
<p><a href="{$site_root_path}" class="linkbutton emphasized">Start using ThinkUp</a></p>
</div>

{else}
Expand Down

0 comments on commit d1c80fa

Please sign in to comment.