Skip to content

Commit 2e74e17

Browse files
author
wrongecho
committed
Show DB updates before git updates
1 parent 3c413ae commit 2e74e17

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

admin_update.php

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,27 @@
3232
</div>
3333
<?php } ?>
3434

35-
<?php if (!empty($git_log)) { ?>
36-
<a class="btn btn-primary btn-lg my-4" href="post.php?update"><i class="fas fa-fw fa-4x fa-download mb-1"></i><h5>Update App</h5></a>
37-
<a class="btn btn-danger btn-lg" href="post.php?update&force_update=1"><i class="fas fa-fw fa-4x fa-hammer mb-1"></i><h5>FORCE Update App</h5></a>
35+
<?php if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) { ?>
36+
<div class="alert alert-warning">
37+
<strong>Ensure you have a current <a href="https://docs.itflow.org/backups">app & database backup</a> before updating!</strong>
38+
</div>
39+
<br>
40+
<a class="btn btn-dark btn-lg my-4" href="post.php?update_db"><i class="fas fa-fw fa-4x fa-download mb-1"></i><h5>Update Database</h5></a>
41+
<br>
42+
<small class="text-secondary">Current DB Version: <?php echo CURRENT_DATABASE_VERSION; ?></small>
43+
<br>
44+
<small class="text-secondary">Latest DB Version: <?php echo LATEST_DATABASE_VERSION; ?></small>
45+
<br>
46+
<small class="text-secondary">Branch: <?php echo $repo_branch; ?></small>
47+
3848
<hr>
3949

4050
<?php } else {
41-
if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) { ?>
42-
<div class="alert alert-warning">
43-
<strong>Ensure you have a current <a href="https://docs.itflow.org/backups">app & database backup</a> before updating!</strong>
44-
</div>
45-
<br>
46-
<a class="btn btn-dark btn-lg my-4" href="post.php?update_db"><i class="fas fa-fw fa-4x fa-download mb-1"></i><h5>Update Database</h5></a>
47-
<br>
48-
<small class="text-secondary">Current DB Version: <?php echo CURRENT_DATABASE_VERSION; ?></small>
49-
<br>
50-
<small class="text-secondary">Latest DB Version: <?php echo LATEST_DATABASE_VERSION; ?></small>
51-
<br>
52-
<small class="text-secondary">Branch: <?php echo $repo_branch; ?></small>
51+
if (!empty($git_log)) { ?>
52+
53+
<a class="btn btn-primary btn-lg my-4" href="post.php?update"><i class="fas fa-fw fa-4x fa-download mb-1"></i><h5>Update App</h5></a>
54+
<a class="btn btn-danger btn-lg" href="post.php?update&force_update=1"><i class="fas fa-fw fa-4x fa-hammer mb-1"></i><h5>FORCE Update App</h5></a>
55+
5356
<?php } else { ?>
5457
<p class="text-secondary">Current Database Version:<br><strong class="text-dark"><?php echo CURRENT_DATABASE_VERSION; ?></strong></p>
5558
<p class="text-secondary">Current App Version:<br><strong class="text-dark"><?php echo $current_version; ?></strong></p>

0 commit comments

Comments
 (0)