Skip to content

Commit

Permalink
Few minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rxtur committed Oct 19, 2018
1 parent eaafd37 commit 1edcde6
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 27 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Blogifier is single blog supporting multiple authors. Administrator can manage c

The [demo site](http://blogifier.azurewebsites.net) is a playground to check out Blogifier features. You can write and publish posts, upload files and test application before install. And no worries, it is just a sandbox and will clean itself.

![demo-img](https://user-images.githubusercontent.com/1932785/38769576-c1d92a8c-3fca-11e8-96a7-acfd848de339.png)
![github-demo](https://user-images.githubusercontent.com/1932785/47130986-eaef1d80-d261-11e8-81d4-c90ad86ff828.png)

## Live blog

Expand Down
60 changes: 44 additions & 16 deletions src/App/Pages/Admin/Upgrade/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
@{
Layout = null;
var repoLink = "https://github.com/blogifierdotnet/Blogifier/releases/tag/v" + Model.NewVersion;

int oldVersion = string.IsNullOrEmpty(Model.OldVersion) ? 0 : int.Parse(Model.OldVersion.Replace(".", ""));
int newVersion = string.IsNullOrEmpty(Model.NewVersion) ? 0 : int.Parse(Model.NewVersion.Replace(".", ""));
}
<!DOCTYPE html>
<html>
Expand All @@ -15,29 +18,54 @@
<br />
<form method="post" asp-antiforgery="true">
<div class="jumbotron">
<h1>Upgrade to version @Model.NewVersion</h1>
<p>
You running Blogifier version @Model.OldVersion. There new version @Model.NewVersion is <a href="@repoLink" target="_blank">available in the repository</a>. You can upgrade to new version manually or just click button below and run in-place upgrade process.
</p>

<div class="alert alert-warning" role="alert">
<p>
Please do <b>back up your data</b> before running upgrade, manual or automatic.
</p>
Upgrade will turn off your web service before replacing files. You may need to manually turn it on again from your hosting admin panel.
</div>
@if (Model.IsUpgrading)
{
<div class="alert alert-success" role="alert">
Upgrade process has started and might take few minutes to run, depending on your server power and blog size. Once completed, aplication will start again.
Upgrade process has started and might take few minutes to run, depending on your server power and blog size.
Give it few minutes, then reload this page.
</div>
<p id="action-buttons">
<a class="btn btn-lg btn-primary" href="~/admin/upgrade" role="button">Reload</a>
</p>
}
else
{
<p id="action-buttons">
<button type="submit" onclick="runUpgrade()" class="btn btn-lg btn-primary">Upgrade now</button>
<a class="btn btn-lg btn-default" href="~/admin" role="button">Cancel</a>
</p>
@if (oldVersion < 21)
{
<h3>Sorry, only versions 2.1.x.x and up support auto-upgrade.</h3>
<p id="action-buttons">
<a class="btn btn-lg btn-default" href="~/admin" role="button">Back</a>
</p>
}
else if (oldVersion >= newVersion)
{
<h3>Your blog is up to date!</h3>
<p id="action-buttons">
<a class="btn btn-lg btn-default" href="~/admin" role="button">Back</a>
</p>
}
else
{
<h1>Upgrade to version @Model.NewVersion</h1>
<p>
You running Blogifier version @Model.OldVersion. New version @Model.NewVersion now <a href="@repoLink" target="_blank">available in the repository</a>.
<br />You can upgrade manually or click button below and run in-place process.
</p>
<div class="alert alert-danger" role="alert">
Please do <b>back up your data</b> before running upgrade, manual or automatic.
</div>
<div class="alert alert-warning">
<p>
Upgrade will turn off your web service before replacing old files. If you using IIS as your web server, it most likely will
restart application once you refresh this page or navigate to any page in the blog.
</p>
If your blog hosted on Linux, you might need to restart web server manually or via host admin panel.
</div>
<p id="action-buttons">
<button type="submit" onclick="runUpgrade()" class="btn btn-lg btn-primary">Upgrade now</button>
<a class="btn btn-lg btn-default" href="~/admin" role="button">Cancel</a>
</p>
}
}
</div>
</form>
Expand Down
Binary file modified src/App/app.db
Binary file not shown.
4 changes: 2 additions & 2 deletions src/App/wwwroot/admin/js/app/fileManagerController.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@ var updateAvatarCallback = function (data) {
toastr.success('Updated');
};
var updateAppCoverCallback = function (data) {
$('#Cover').val(data.url);
$('#BlogItem_Cover').val(data.url);
toastr.success('Updated');
};
var updateAppLogoCallback = function (data) {
$('#Logo').val(data.url);
$('#BlogItem_Logo').val(data.url);
toastr.success('Updated');
};

Expand Down
2 changes: 1 addition & 1 deletion src/Core/Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<Version>2.0.2.9</Version>
<Version>2.0.3.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
7 changes: 0 additions & 7 deletions src/Upgrade/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,6 @@ static void ReplaceFolder(string folder)
}
}

static string NameFromPath(string path)
{
int x = path.LastIndexOf(_slash);
string name = path.Substring(x);
return name;
}

static List<string> GetCoreFiles()
{
var fileName = $"{_upgDir}{_slash}files.txt";
Expand Down

0 comments on commit 1edcde6

Please sign in to comment.