Skip to content

Commit 1edcde6

Browse files
committed
Few minor fixes
1 parent eaafd37 commit 1edcde6

File tree

6 files changed

+48
-27
lines changed

6 files changed

+48
-27
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Blogifier is single blog supporting multiple authors. Administrator can manage c
2424

2525
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.
2626

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

2929
## Live blog
3030

src/App/Pages/Admin/Upgrade/Index.cshtml

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
@{
44
Layout = null;
55
var repoLink = "https://github.com/blogifierdotnet/Blogifier/releases/tag/v" + Model.NewVersion;
6+
7+
int oldVersion = string.IsNullOrEmpty(Model.OldVersion) ? 0 : int.Parse(Model.OldVersion.Replace(".", ""));
8+
int newVersion = string.IsNullOrEmpty(Model.NewVersion) ? 0 : int.Parse(Model.NewVersion.Replace(".", ""));
69
}
710
<!DOCTYPE html>
811
<html>
@@ -15,29 +18,54 @@
1518
<br />
1619
<form method="post" asp-antiforgery="true">
1720
<div class="jumbotron">
18-
<h1>Upgrade to version @Model.NewVersion</h1>
19-
<p>
20-
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.
21-
</p>
22-
23-
<div class="alert alert-warning" role="alert">
24-
<p>
25-
Please do <b>back up your data</b> before running upgrade, manual or automatic.
26-
</p>
27-
Upgrade will turn off your web service before replacing files. You may need to manually turn it on again from your hosting admin panel.
28-
</div>
2921
@if (Model.IsUpgrading)
3022
{
3123
<div class="alert alert-success" role="alert">
32-
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.
24+
Upgrade process has started and might take few minutes to run, depending on your server power and blog size.
25+
Give it few minutes, then reload this page.
3326
</div>
27+
<p id="action-buttons">
28+
<a class="btn btn-lg btn-primary" href="~/admin/upgrade" role="button">Reload</a>
29+
</p>
3430
}
3531
else
3632
{
37-
<p id="action-buttons">
38-
<button type="submit" onclick="runUpgrade()" class="btn btn-lg btn-primary">Upgrade now</button>
39-
<a class="btn btn-lg btn-default" href="~/admin" role="button">Cancel</a>
40-
</p>
33+
@if (oldVersion < 21)
34+
{
35+
<h3>Sorry, only versions 2.1.x.x and up support auto-upgrade.</h3>
36+
<p id="action-buttons">
37+
<a class="btn btn-lg btn-default" href="~/admin" role="button">Back</a>
38+
</p>
39+
}
40+
else if (oldVersion >= newVersion)
41+
{
42+
<h3>Your blog is up to date!</h3>
43+
<p id="action-buttons">
44+
<a class="btn btn-lg btn-default" href="~/admin" role="button">Back</a>
45+
</p>
46+
}
47+
else
48+
{
49+
<h1>Upgrade to version @Model.NewVersion</h1>
50+
<p>
51+
You running Blogifier version @Model.OldVersion. New version @Model.NewVersion now <a href="@repoLink" target="_blank">available in the repository</a>.
52+
<br />You can upgrade manually or click button below and run in-place process.
53+
</p>
54+
<div class="alert alert-danger" role="alert">
55+
Please do <b>back up your data</b> before running upgrade, manual or automatic.
56+
</div>
57+
<div class="alert alert-warning">
58+
<p>
59+
Upgrade will turn off your web service before replacing old files. If you using IIS as your web server, it most likely will
60+
restart application once you refresh this page or navigate to any page in the blog.
61+
</p>
62+
If your blog hosted on Linux, you might need to restart web server manually or via host admin panel.
63+
</div>
64+
<p id="action-buttons">
65+
<button type="submit" onclick="runUpgrade()" class="btn btn-lg btn-primary">Upgrade now</button>
66+
<a class="btn btn-lg btn-default" href="~/admin" role="button">Cancel</a>
67+
</p>
68+
}
4169
}
4270
</div>
4371
</form>

src/App/app.db

0 Bytes
Binary file not shown.

src/App/wwwroot/admin/js/app/fileManagerController.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,11 @@ var updateAvatarCallback = function (data) {
207207
toastr.success('Updated');
208208
};
209209
var updateAppCoverCallback = function (data) {
210-
$('#Cover').val(data.url);
210+
$('#BlogItem_Cover').val(data.url);
211211
toastr.success('Updated');
212212
};
213213
var updateAppLogoCallback = function (data) {
214-
$('#Logo').val(data.url);
214+
$('#BlogItem_Logo').val(data.url);
215215
toastr.success('Updated');
216216
};
217217

src/Core/Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp2.1</TargetFramework>
5-
<Version>2.0.2.9</Version>
5+
<Version>2.0.3.0</Version>
66
</PropertyGroup>
77

88
<ItemGroup>

src/Upgrade/Program.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,6 @@ static void ReplaceFolder(string folder)
9898
}
9999
}
100100

101-
static string NameFromPath(string path)
102-
{
103-
int x = path.LastIndexOf(_slash);
104-
string name = path.Substring(x);
105-
return name;
106-
}
107-
108101
static List<string> GetCoreFiles()
109102
{
110103
var fileName = $"{_upgDir}{_slash}files.txt";

0 commit comments

Comments
 (0)