21 | @Html.EditorFor(model => model.Content)
22 | @Html.ValidationMessageFor(model => model.Content, string.Empty, new { @class = "text-danger" })
23 |
24 |
25 |
2 |
3 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Areas/Administration/Views/Home/Index.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Administration";
3 | }
4 |
5 | @ViewBag.Title
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Areas/Administration/Views/Pages/Create.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.Areas.Administration.ViewModels.Pages.PageViewModel
2 |
3 | @{
4 | ViewBag.Title = "Create Page";
5 | }
6 |
7 | @ViewBag.Title
8 |
9 |
10 | @using (Html.BeginForm("Create", "Pages", FormMethod.Post))
11 | {
12 | @Html.AntiForgeryToken()
13 | @Html.ValidationSummary(true, string.Empty, new { @class = "text-danger" })
14 |
15 |
16 | @Html.LabelFor(model => model.Title, htmlAttributes: new { @class = "control-label" })
17 |
18 | @Html.EditorFor(model => model.Title, new { htmlAttributes = new { @class = "form-control" } })
19 | @Html.ValidationMessageFor(model => model.Title, "", new { @class = "text-danger" })
20 |
21 |
22 |
23 | @Html.LabelFor(model => model.Content, htmlAttributes: new { @class = "control-label" })
24 |
25 | @Html.EditorFor(model => model.Content, new { htmlAttributes = new { @class = "form-control" } })
26 | @Html.ValidationMessageFor(model => model.Content, "", new { @class = "text-danger" })
27 |
28 |
29 |
30 | @Html.LabelFor(model => model.VisibleInMenu, htmlAttributes: new { @class = "form-check-label" })
31 |
32 | @Html.EditorFor(model => model.VisibleInMenu, new { htmlAttributes = new { @class = "form-control" } })
33 | @Html.ValidationMessageFor(model => model.VisibleInMenu, string.Empty, new { @class = "text-danger" })
34 |
35 |
36 |
37 |
38 |
39 | @Html.ActionLink("Cancel", "Index", "Pages", new { area = "Administration" }, new { @class = "btn btn-danger" })
40 |
41 | }
42 |
43 | @section Scripts {
44 | @Scripts.Render("~/bundles/jqueryval")
45 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Areas/Administration/Views/Pages/Edit.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.Areas.Administration.ViewModels.Pages.PageViewModel
2 |
3 | @{
4 | ViewBag.Title = "Edit Page";
5 | }
6 |
7 | @ViewBag.Title
8 |
9 |
10 | @using (Html.BeginForm("Edit", "Pages", FormMethod.Post))
11 | {
12 | @Html.AntiForgeryToken()
13 |
14 | @Html.ValidationSummary(true, "", new { @class = "text-danger" })
15 |
16 | @Html.HiddenFor(m => m.Id)
17 | @Html.HiddenFor(m => m.AuthorId)
18 | @Html.HiddenFor(m => m.CreatedOn)
19 | @Html.HiddenFor(m => m.Permalink)
20 |
21 |
22 | @Html.LabelFor(m => m.Title, htmlAttributes: new { @class = "control-label" })
23 |
24 | @Html.EditorFor(m => m.Title, new { htmlAttributes = new { @class = "form-control" } })
25 | @Html.ValidationMessageFor(m => m.Title, "", new { @class = "text-danger" })
26 |
27 |
28 |
29 | @Html.LabelFor(m => m.Content, htmlAttributes: new { @class = "control-label" })
30 |
31 | @Html.EditorFor(model => model.Content, new { htmlAttributes = new { @class = "form-control" } })
32 | @Html.ValidationMessageFor(m => m.Content, "", new { @class = "text-danger" })
33 |
34 |
35 |
36 | @Html.LabelFor(m => m.VisibleInMenu, htmlAttributes: new { @class = "control-label" })
37 |
38 | @Html.EditorFor(m => m.VisibleInMenu, new { htmlAttributes = new { @class = "form-control" } })
39 | @Html.ValidationMessageFor(m => m.VisibleInMenu, string.Empty, new { @class = "text-danger" })
40 |
41 |
42 |
43 |
44 |
45 | @Html.ActionLink("Cancel", "Index", "Pages", new { area = "Administration" }, new { @class = "btn btn-danger" })
46 |
47 | }
48 |
49 | @section Scripts {
50 | @Scripts.Render("~/bundles/jqueryval")
51 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Areas/Administration/Views/Pages/Index.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.Areas.Administration.ViewModels.Pages.IndexPagesViewModel
2 |
3 | @{
4 | ViewBag.Title = "All Pages";
5 | }
6 |
7 |
15 |
16 | @if (Model.Pages.Any())
17 | {
18 |
19 |
20 |
21 | # |
22 | Title |
23 | Created On |
24 | Modified On |
25 | Author |
26 | Actions |
27 |
28 |
29 |
30 | @foreach (var page in Model.Pages)
31 | {
32 |
33 | @page.Id |
34 | @page.Title |
35 | @Html.DisplayFor(m => page.CreatedOn) |
36 | @Html.DisplayFor(m => page.ModifiedOn) |
37 | @page.Author |
38 |
39 |
49 | |
50 |
51 | }
52 |
53 |
54 | }
55 | else
56 | {
57 | No pages available.
58 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Areas/Administration/Views/Posts/Create.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.Areas.Administration.ViewModels.Posts.PostViewModel
2 |
3 | @{
4 | ViewBag.Title = "Create Post";
5 | }
6 |
7 | @ViewBag.Title
8 |
9 |
10 | @using (Html.BeginForm("Create", "Posts", FormMethod.Post))
11 | {
12 | @Html.AntiForgeryToken()
13 | @Html.ValidationSummary(true, string.Empty, new { @class = "text-danger" })
14 |
15 |
16 | @Html.LabelFor(m => m.Title)
17 |
18 | @Html.EditorFor(m => m.Title, new { htmlAttributes = new { @class = "form-control" } })
19 | @Html.ValidationMessageFor(m => m.Title, string.Empty, new { @class = "text-danger" })
20 |
21 |
22 |
23 | @Html.LabelFor(m => m.Content)
24 |
25 | @Html.EditorFor(m => m.Content, new { htmlAttributes = new { @class = "form-control" } })
26 | @Html.ValidationMessageFor(m => m.Content, string.Empty, new { @class = "text-danger" })
27 |
28 |
29 |
30 |
31 |
32 | @Html.ActionLink("Cancel", "Index", new { area = "Administration" }, new { @class = "btn btn-danger" })
33 |
34 | }
35 |
36 | @section Scripts {
37 | @Scripts.Render("~/bundles/jqueryval")
38 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Areas/Administration/Views/Posts/Edit.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.Areas.Administration.ViewModels.Posts.PostViewModel
2 |
3 | @{
4 | ViewBag.Title = "Edit Post";
5 | }
6 |
7 | @ViewBag.Title
8 |
9 |
10 | @using (Html.BeginForm("Edit", "Posts", FormMethod.Post))
11 | {
12 | @Html.AntiForgeryToken()
13 |
14 | @Html.HiddenFor(m => m.Id)
15 | @Html.HiddenFor(m => m.AuthorId)
16 |
17 |
18 | @Html.LabelFor(m => m.Title)
19 |
20 | @Html.EditorFor(m => m.Title, new { htmlAttributes = new { @class = "form-control" } })
21 | @Html.ValidationMessageFor(m => m.Title, string.Empty, new { @class = "text-danger" })
22 |
23 |
24 |
25 | @Html.LabelFor(m => m.Content)
26 |
27 | @Html.EditorFor(m => m.Content, new { htmlAttributes = new { @class = "form-control" } })
28 | @Html.ValidationMessageFor(m => m.Content, string.Empty, new { @class = "text-danger" })
29 |
30 |
31 |
32 |
33 |
34 | @Html.ActionLink("Cancel", "Index", new { area = "Administration" }, new { @class = "btn btn-danger" })
35 |
36 | }
37 |
38 | @section Scripts {
39 | @Scripts.Render("~/bundles/jqueryval")
40 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Areas/Administration/Views/Posts/Index.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.Areas.Administration.ViewModels.Posts.IndexPostsPageViewModel
2 |
3 | @{
4 | ViewBag.Title = "All Posts";
5 | }
6 |
7 |
15 |
16 | @if (Model.Posts.Any())
17 | {
18 |
19 |
20 |
21 | # |
22 | Title |
23 | Created On |
24 | Modified On |
25 | Author |
26 | Actions |
27 |
28 |
29 |
30 | @foreach (var post in Model.Posts)
31 | {
32 |
33 | @post.Id |
34 | @post.Title |
35 | @Html.DisplayFor(m => post.CreatedOn) |
36 | @Html.DisplayFor(m => post.ModifiedOn) |
37 | @post.Author |
38 |
39 |
49 | |
50 |
51 | }
52 |
53 |
54 | }
55 | else
56 | {
57 | No posts available.
58 | }
59 |
60 | @Html.Partial("_Pagination")
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Areas/Administration/Views/Settings/Index.cshtml:
--------------------------------------------------------------------------------
1 | @model IEnumerable
2 |
3 | @{
4 | ViewBag.Title = "All Settings";
5 | }
6 |
7 | @ViewBag.Title
8 |
9 |
10 |
11 |
12 |
13 |
14 | @Html.DisplayNameFor(model => model.Key)
15 | |
16 |
17 | @Html.DisplayNameFor(model => model.Value)
18 | |
19 | Update |
20 |
21 |
22 |
23 | @foreach (var setting in Model)
24 | {
25 |
26 | @setting.Key.Replace('_', ' ') |
27 |
28 | @if(setting.Value.Length > 50)
29 | {
30 | @setting.Value.Substring(0, 50)
31 | }
32 | else {
33 | @setting.Value
34 | }
35 | |
36 |
37 | @Html.ActionLink("Update", "Update", new { id = setting.Key, area = "Administration" }, new { @class="btn btn-info "})
38 | |
39 |
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Areas/Administration/Views/Settings/Update.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Data.Models.Setting
2 |
3 | @{
4 | ViewBag.Title = "Update Setting";
5 | }
6 |
7 | @Model.Key.Replace('_', ' ')
8 |
9 |
10 | @using (Html.BeginForm("Update", "Settings", FormMethod.Post))
11 | {
12 | @Html.AntiForgeryToken()
13 | @Html.ValidationSummary(true, "", new { @class = "text-danger" })
14 |
15 | @Html.HiddenFor(model => Model.Key)
16 |
17 |
18 | @Html.EditorFor(model => Model.Value, new { htmlAttributes = new { @class = "form-control" } })
19 | @Html.ValidationMessageFor(model => Model.Value, "", new { @class = "text-danger" })
20 |
21 |
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Areas/Administration/Views/Shared/_Header.cshtml:
--------------------------------------------------------------------------------
1 | @using Microsoft.AspNet.Identity
2 |
3 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Areas/Administration/Views/Shared/_Layout.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | @ViewBag.Title - @ViewData["Blog_Title"]
9 |
10 | @Styles.Render("~/Content/tether")
11 | @Styles.Render("~/Content/bootstrap")
12 | @Styles.Render("~/Content/fonts")
13 | @Styles.Render("~/Content/administration")
14 |
15 |
16 | @Html.Partial("_Header")
17 |
18 |
19 |
20 | @{ Html.RenderAction("AdminMenu", "Home"); }
21 |
22 |
23 | @RenderBody()
24 |
25 |
26 |
27 |
28 | @Scripts.Render("~/bundles/jquery")
29 | @Scripts.Render("~/bundles/tether")
30 | @Scripts.Render("~/bundles/bootstrap")
31 |
32 | @RenderSection("scripts", false)
33 |
34 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Areas/Administration/Views/Shared/_Pagination.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.Areas.Administration.ViewModels.Administration.PaginationViewModel
2 |
3 | @if (Model.PagesCount > 0)
4 | {
5 |
38 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Areas/Administration/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "~/Areas/Administration/Views/Shared/_Layout.cshtml";
3 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Areas/Administration/Views/web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Content/administration.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding-top: 57px;
3 | }
4 |
5 | .sidebar {
6 | position: fixed;
7 | top: 51px;
8 | bottom: 0;
9 | left: 0;
10 | z-index: 1000;
11 | padding: 20px 0;
12 | overflow-x: hidden;
13 | overflow-y: auto;
14 | /*border-right: 1px solid #eee;*/
15 | }
16 |
17 | .sidebar .nav {
18 | margin-bottom: 20px;
19 | }
20 |
21 | .sidebar .nav-item {
22 | width: 100%;
23 | }
24 |
25 | .sidebar .nav-item + .nav-item {
26 | margin-left: 0;
27 | }
28 |
29 | .sidebar .nav-link {
30 | border-radius: 0;
31 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Content/bootstrap-reboot.min.css.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["../../scss/_normalize.scss","bootstrap-reboot.css","../../scss/_reboot.scss","../../scss/_variables.scss","../../scss/mixins/_hover.scss"],"names":[],"mappings":"4EAYA,KACE,YAAA,WACA,YAAA,KACA,qBAAA,KACA,yBAAA,KAUF,KACE,OAAA,EAOF,QAAA,MAAA,OAAA,OAAA,IAAA,QAME,QAAA,MAQF,GACE,UAAA,IACA,OAAA,MAAA,EAWF,WAAA,OAAA,KAGE,QAAA,MAOF,OACE,OAAA,IAAA,KAQF,GACE,mBAAA,YAAA,WAAA,YACA,OAAA,EACA,SAAA,QAQF,IACE,YAAA,UAAA,UACA,UAAA,IAWF,EACE,iBAAA,YACA,6BAAA,QAQF,SAAA,QAEE,cAAA,EAQF,YACE,cAAA,KACA,gBAAA,UACA,gBAAA,UAAA,OAOF,EAAA,OAEE,YAAA,QAOF,EAAA,OAEE,YAAA,OAQF,KAAA,IAAA,KAGE,YAAA,UAAA,UACA,UAAA,IAOF,IACE,WAAA,OAOF,KACE,iBAAA,KACA,MAAA,KAOF,MACE,UAAA,IAQF,IAAA,IAEE,UAAA,IACA,YAAA,EACA,SAAA,SACA,eAAA,SAGF,IACE,OAAA,OAGF,IACE,IAAA,MAUF,MAAA,MAEE,QAAA,aAOF,sBACE,QAAA,KACA,OAAA,EAOF,IACE,aAAA,KAOF,eACE,SAAA,OAWF,OAAA,MAAA,SAAA,OAAA,SAKE,YAAA,WACA,UAAA,KACA,YAAA,KACA,OAAA,EAQF,OAAA,MAEE,SAAA,QAQF,OAAA,OAEE,eAAA,KASF,aAAA,cAAA,OAAA,mBAIE,mBAAA,OAOF,gCAAA,+BAAA,gCAAA,yBAIE,aAAA,KACA,QAAA,EAOF,6BAAA,4BAAA,6BAAA,sBAIE,QAAA,IAAA,OAAA,WAOF,SACE,OAAA,IAAA,MAAA,OACA,OAAA,EAAA,IACA,QAAA,MAAA,OAAA,MAUF,OACE,mBAAA,WAAA,WAAA,WACA,MAAA,QACA,QAAA,MACA,UAAA,KACA,QAAA,EACA,YAAA,OAQF,SACE,QAAA,aACA,eAAA,SAOF,SACE,SAAA,KCrKF,gBAAA,aD+KE,mBAAA,WAAA,WAAA,WACA,QAAA,EC1KF,yCAAA,yCDmLE,OAAA,KC9KF,cDuLE,mBAAA,UACA,eAAA,KCnLF,4CAAA,yCD4LE,mBAAA,KAQF,6BACE,mBAAA,OACA,KAAA,QAWF,QAAA,KAEE,QAAA,MAOF,QACE,QAAA,UAUF,OACE,QAAA,aAOF,SACE,QAAA,KCnNF,SD8NE,QAAA,KEtbF,KACE,mBAAA,WAAA,WAAA,WAGF,EAAA,QAAA,SAGE,mBAAA,QAAA,WAAA,QAoBA,cAAgB,MAAA,aAQlB,KAYE,mBAAA,UAGA,4BAAA,YAGF,KACE,YAAA,cAAA,UAAA,mBAAA,WAAA,OC2K4H,iBD3K5H,MAAA,WACA,UAAA,KACA,YAAA,IACA,YAAA,IAEA,MAAA,QAEA,iBAAA,KD2LF,sBClLE,QAAA,YAYF,GAAI,GAAI,GAAI,GAAI,GAAI,GAClB,WAAA,EACA,cAAA,MAOF,EACE,WAAA,EACA,cAAA,KAIF,0BAAA,YAGE,OAAA,KAGF,QACE,cAAA,KACA,WAAA,OACA,YAAA,QAGF,GAAA,GAAA,GAGE,WAAA,EACA,cAAA,KAGF,MAAA,MAAA,MAAA,MAIE,cAAA,EAGF,GACE,YAAA,IAGF,GACE,cAAA,MACA,YAAA,EAGF,WACE,OAAA,EAAA,EAAA,KAQF,EACE,MAAA,QACA,gBAAA,KEhJE,QAAA,QFmJA,MAAA,QACA,gBAAA,UAUJ,8BACE,MAAA,QACA,gBAAA,KEhKE,oCAAA,oCFmKA,MAAA,QACA,gBAAA,KANJ,oCAUI,QAAA,EASJ,IAEE,WAAA,EAEA,cAAA,KAEA,SAAA,KAQF,OAGE,OAAA,EAAA,EAAA,KAQF,IAGE,eAAA,ODsIF,cCzHE,OAAA,QAcF,cAAA,EAAA,KAAA,OAAA,MAAA,MAAA,OAAA,QAAA,SASE,iBAAA,aAAA,aAAA,aAQF,MAEE,gBAAA,SAEA,iBAAA,YAGF,QACE,YAAA,OACA,eAAA,OACA,MAAA,QACA,WAAA,KACA,aAAA,OAGF,GAEE,WAAA,KAQF,MAEE,QAAA,aACA,cAAA,MAOF,aACE,QAAA,IAAA,OACA,QAAA,IAAA,KAAA,yBAGF,OAAA,MAAA,OAAA,SAME,YAAA,QAGF,8BAAA,2BAMI,OAAA,YAKJ,iBAAA,iBAAA,2BAAA,kBASE,mBAAA,QAGF,SAEE,OAAA,SAGF,SAME,UAAA,EAEA,QAAA,EACA,OAAA,EACA,OAAA,EAGF,OAEE,QAAA,MACA,MAAA,KACA,QAAA,EACA,cAAA,MACA,UAAA,OACA,YAAA,QAGF,mBAKE,mBAAA,KAIF,OACE,QAAA,aDsEF,SC9DE,QAAA"}
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Content/tether/tether-theme-basic.css:
--------------------------------------------------------------------------------
1 | .tether-element, .tether-element:after, .tether-element:before, .tether-element *, .tether-element *:after, .tether-element *:before {
2 | box-sizing: border-box; }
3 |
4 | .tether-element {
5 | position: absolute;
6 | display: none; }
7 | .tether-element.tether-open {
8 | display: block; }
9 |
10 | .tether-element.tether-theme-basic {
11 | max-width: 100%;
12 | max-height: 100%; }
13 | .tether-element.tether-theme-basic .tether-content {
14 | border-radius: 5px;
15 | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
16 | font-family: inherit;
17 | background: #fff;
18 | color: inherit;
19 | padding: 1em;
20 | font-size: 1.1em;
21 | line-height: 1.5em; }
22 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Content/tether/tether-theme-basic.min.css:
--------------------------------------------------------------------------------
1 | .tether-element,.tether-element *,.tether-element :after,.tether-element :before,.tether-element:after,.tether-element:before{box-sizing:border-box}.tether-element{position:absolute;display:none}.tether-element.tether-open{display:block}.tether-element.tether-theme-basic{max-width:100%;max-height:100%}.tether-element.tether-theme-basic .tether-content{border-radius:5px;box-shadow:0 2px 8px rgba(0,0,0,.2);font-family:inherit;background:#fff;color:inherit;padding:1em;font-size:1.1em;line-height:1.5em}
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Content/tether/tether.css:
--------------------------------------------------------------------------------
1 | .tether-element, .tether-element:after, .tether-element:before, .tether-element *, .tether-element *:after, .tether-element *:before {
2 | box-sizing: border-box; }
3 |
4 | .tether-element {
5 | position: absolute;
6 | display: none; }
7 | .tether-element.tether-open {
8 | display: block; }
9 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Content/tether/tether.min.css:
--------------------------------------------------------------------------------
1 | .tether-element,.tether-element *,.tether-element :after,.tether-element :before,.tether-element:after,.tether-element:before{box-sizing:border-box}.tether-element{position:absolute;display:none}.tether-element.tether-open{display:block}
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Content/vs.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Visual Studio-like style based on original C# coloring by Jason Diamond
4 |
5 | */
6 | .hljs {
7 | display: block;
8 | overflow-x: auto;
9 | padding: 0.5em;
10 | background: white;
11 | color: black;
12 | }
13 |
14 | .hljs-comment,
15 | .hljs-quote,
16 | .hljs-variable {
17 | color: #008000;
18 | }
19 |
20 | .hljs-keyword,
21 | .hljs-selector-tag,
22 | .hljs-built_in,
23 | .hljs-name,
24 | .hljs-tag {
25 | color: #00f;
26 | }
27 |
28 | .hljs-string,
29 | .hljs-title,
30 | .hljs-section,
31 | .hljs-attribute,
32 | .hljs-literal,
33 | .hljs-template-tag,
34 | .hljs-template-variable,
35 | .hljs-type,
36 | .hljs-addition {
37 | color: #a31515;
38 | }
39 |
40 | .hljs-deletion,
41 | .hljs-selector-attr,
42 | .hljs-selector-pseudo,
43 | .hljs-meta {
44 | color: #2b91af;
45 | }
46 |
47 | .hljs-doctag {
48 | color: #808080;
49 | }
50 |
51 | .hljs-attr {
52 | color: #f00;
53 | }
54 |
55 | .hljs-symbol,
56 | .hljs-bullet,
57 | .hljs-link {
58 | color: #00b0e8;
59 | }
60 |
61 |
62 | .hljs-emphasis {
63 | font-style: italic;
64 | }
65 |
66 | .hljs-strong {
67 | font-weight: bold;
68 | }
69 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Controllers/BaseController.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web.Controllers
2 | {
3 | using System.Web.Mvc;
4 |
5 | using BlogSystem.Web.Infrastructure.Identity;
6 | using BlogSystem.Web.Infrastructure.Attributes;
7 |
8 | using BlogSystem.Web.Services.Mapping;
9 | using BlogSystem.Web.Services.Caching;
10 |
11 | [PassSettingsToViewData]
12 | public abstract class BaseController : Controller
13 | {
14 | public ICurrentUser CurrentUser { get; set; }
15 |
16 | public IMappingService Mapper { get; set; }
17 |
18 | public ICacheService Cache { get; set; }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Controllers/CommentsController.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web.Controllers
2 | {
3 | using System.Linq;
4 | using System.Web.Mvc;
5 |
6 | using BlogSystem.Data.Models;
7 | using BlogSystem.Data.Repositories;
8 |
9 | using BlogSystem.Web.ViewModels.Comments;
10 |
11 | using BlogSystem.Web.Infrastructure.XSS;
12 | using BlogSystem.Web.Infrastructure.Attributes;
13 |
14 | [Authorize]
15 | public class CommentsController : BaseController
16 | {
17 | private readonly IDbRepository commentsData;
18 | private readonly ISanitizer sanitizer;
19 |
20 | public CommentsController(IDbRepository commentsData, ISanitizer sanitizer)
21 | {
22 | this.commentsData = commentsData;
23 | this.sanitizer = sanitizer;
24 | }
25 |
26 | [AjaxOnly]
27 | [AllowAnonymous]
28 | public PartialViewResult All(int id)
29 | {
30 | var comments = this.commentsData.All().Where(c => c.PostId == id).OrderByDescending(c => c.CreatedOn);
31 | var model = this.Mapper.Map(comments).ToList();
32 |
33 | return this.PartialView(model);
34 | }
35 |
36 | [HttpPost]
37 | [ValidateAntiForgeryToken]
38 | public ActionResult Create(int id, CommentViewModel model)
39 | {
40 | if (model != null && this.ModelState.IsValid)
41 | {
42 | var userId = this.CurrentUser.GetUser().Id;
43 | var content = this.sanitizer.Sanitize(model.Content);
44 |
45 | var comment = new Comment
46 | {
47 | PostId = id,
48 | Content = content,
49 | AuthorId = userId
50 | };
51 |
52 | this.commentsData.Add(comment);
53 | this.commentsData.SaveChanges();
54 |
55 | return this.RedirectToAction("All", new { id = model.Id });
56 | }
57 |
58 | return this.Json("Content is required");
59 | }
60 | }
61 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Controllers/HomeController.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web.Controllers
2 | {
3 | using System;
4 | using System.Linq;
5 | using System.Web.Mvc;
6 |
7 | using BlogSystem.Common;
8 | using BlogSystem.Data.Models;
9 | using BlogSystem.Data.Repositories;
10 | using BlogSystem.Web.ViewModels.Home;
11 |
12 | public class HomeController : BaseController
13 | {
14 | private readonly IDbRepository postsData;
15 |
16 | public HomeController(IDbRepository postsData)
17 | {
18 | this.postsData = postsData;
19 | }
20 |
21 | public ActionResult Index(int page = 1, int perPage = GlobalConstants.DefaultPageSize)
22 | {
23 | var pagesCount = (int) Math.Ceiling(this.postsData.All().Count() / (decimal) perPage);
24 | var postsPage = this.postsData.All().OrderByDescending(p => p.CreatedOn).Skip(perPage * (page - 1)).Take(perPage);
25 | var posts = this.Mapper.Map(postsPage).ToList();
26 |
27 | var model = new IndexPageViewModel
28 | {
29 | Posts = posts,
30 | CurrentPage = page,
31 | PagesCount = pagesCount
32 | };
33 |
34 | return this.View(model);
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="BlogSystem.Web.MvcApplication" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Global.asax.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web
2 | {
3 | using System.Web;
4 | using System.Web.Mvc;
5 | using System.Web.Optimization;
6 | using System.Web.Routing;
7 | using System.Reflection;
8 |
9 | using BlogSystem.Web.Infrastructure.Mapping;
10 |
11 | public class MvcApplication : HttpApplication
12 | {
13 | protected void Application_Start()
14 | {
15 | DataConfig.ConfigureDatabase();
16 |
17 | AreaRegistration.RegisterAllAreas();
18 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
19 | RouteConfig.RegisterRoutes(RouteTable.Routes);
20 | BundleConfig.RegisterBundles(BundleTable.Bundles);
21 | ViewEngineConfig.RegisterViewEngines(ViewEngines.Engines);
22 |
23 | AutofacConfig.RegisterAutofac();
24 | AutoMapperConfig.RegisterMappings(Assembly.GetExecutingAssembly());
25 |
26 | MvcHandler.DisableMvcResponseHeader = true;
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | [assembly: AssemblyTitle("BlogSystem.Web")]
6 | [assembly: AssemblyDescription("")]
7 | [assembly: AssemblyConfiguration("")]
8 | [assembly: AssemblyCompany("")]
9 | [assembly: AssemblyProduct("BlogSystem.Web")]
10 | [assembly: AssemblyCopyright("Copyright © 2017 Ivan Ivanov")]
11 | [assembly: AssemblyTrademark("")]
12 | [assembly: AssemblyCulture("")]
13 | [assembly: ComVisible(false)]
14 | [assembly: Guid("f1c70659-0515-4001-8110-216ee0c758f2")]
15 | [assembly: AssemblyVersion("1.0.*")]
16 | [assembly: AssemblyFileVersion("1.0")]
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Scripts/_references.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ivanovx/BlogSystem/b5cc738df8e8b8acc1dca0d8ef80a72204092426/src/BlogSystem.Web/Scripts/_references.js
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Scripts/blog.js:
--------------------------------------------------------------------------------
1 | var BlogSystem = BlogSystem || {};
2 |
3 | $("#new-comment").hide();
4 |
5 | BlogSystem.onGetCommentsSuccess = function () {
6 | $("#show-comments").hide();
7 | $("#new-comment").show();
8 |
9 | console.log("Success get posts comment");
10 | };
11 |
12 | BlogSystem.onAddCommentSuccess = function () {
13 | $.notify("Comment successfully created!", "success");
14 |
15 | $("#new-comment").hide();
16 |
17 | console.log("Comment successfully created!");
18 | };
19 |
20 | BlogSystem.onCreateCommentFailure = function (data) {
21 | $.notify("An error has occurred. Please try again later...", "error");
22 |
23 | console.log(data);
24 | };
25 |
26 | /*
27 | $(window).scroll(function () {
28 | if ($(document).scrollTop() > 50) {
29 | $(".navbar").addClass("navbar-shrink");
30 | } else {
31 | $(".navbar").removeClass("navbar-shrink");
32 | }
33 | });*/
34 |
35 | var isMobile = window.matchMedia("only screen and (max-width: 760px)");
36 |
37 | if (!isMobile.matches) {
38 | $(window).bind("scroll", function () {
39 | if ($(window).scrollTop() > 340) {
40 | $(".navbar").addClass("fixed-top");
41 | } else {
42 | $(".navbar").removeClass("fixed-top");
43 | }
44 | });
45 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Scripts/tether.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ivanovx/BlogSystem/b5cc738df8e8b8acc1dca0d8ef80a72204092426/src/BlogSystem.Web/Scripts/tether.js
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Scripts/tether.min.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ivanovx/BlogSystem/b5cc738df8e8b8acc1dca0d8ef80a72204092426/src/BlogSystem.Web/Scripts/tether.min.js
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Scripts/tinymce/langs/readme.md:
--------------------------------------------------------------------------------
1 | This is where language files should be placed.
2 |
3 | Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/
4 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Scripts/tinymce/plugins/anchor/plugin.min.js:
--------------------------------------------------------------------------------
1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i",b.each(d,function(b){var d=c+"/img/smiley-"+b+".gif";a+=' | '}),a+=""}),a+=""}var e=[["cool","cry","embarassed","foot-in-mouth"],["frown","innocent","kiss","laughing"],["money-mouth","sealed","smile","surprised"],["tongue-out","undecided","wink","yell"]];a.addButton("emoticons",{type:"panelbutton",panel:{role:"application",autohide:!0,html:d,onclick:function(b){var c=a.dom.getParent(b.target,"a");c&&(a.insertContent('
'),this.hide())}},tooltip:"Emoticons"})}),function(){}}),d("0")()}();
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Scripts/tinymce/plugins/fullscreen/plugin.min.js:
--------------------------------------------------------------------------------
1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i")}),a.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),a.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})}),function(){}}),d("0")()}();
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Scripts/tinymce/plugins/insertdatetime/plugin.min.js:
--------------------------------------------------------------------------------
1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i'+d+"";var f=a.dom.getParent(a.selection.getStart(),"time");if(f)return void a.dom.setOuterHTML(f,d)}a.insertContent(d)}var e,f,g="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),i="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),j="January February March April May June July August September October November December".split(" "),k=[];a.addCommand("mceInsertDate",function(){d(a.getParam("insertdatetime_dateformat",a.translate("%Y-%m-%d")))}),a.addCommand("mceInsertTime",function(){d(a.getParam("insertdatetime_timeformat",a.translate("%H:%M:%S")))}),a.addButton("insertdatetime",{type:"splitbutton",title:"Insert date/time",onclick:function(){d(e||f)},menu:k}),b.each(a.settings.insertdatetime_formats||["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"],function(a){f||(f=a),k.push({text:c(a),onclick:function(){e=a,d(a)}})}),a.addMenuItem("insertdatetime",{icon:"date",text:"Date/time",menu:k,context:"insert"})}),function(){}}),d("0")()}();
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Scripts/tinymce/plugins/nonbreaking/plugin.min.js:
--------------------------------------------------------------------------------
1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i ':" "),a.dom.setAttrib(a.dom.select("span.mce-nbsp"),"data-mce-bogus","1")}),a.addButton("nonbreaking",{title:"Nonbreaking space",cmd:"mceNonBreaking"}),a.addMenuItem("nonbreaking",{text:"Nonbreaking space",cmd:"mceNonBreaking",context:"insert"}),b){var c=+b>1?+b:3;a.on("keydown",function(b){if(9==b.keyCode){if(b.shiftKey)return;b.preventDefault();for(var d=0;d0?h.charAt(d-1):"";if('"'===e)return b;if(">"===e){var f=h.lastIndexOf("<",d);if(f!==-1){var g=h.substring(f,d);if(g.indexOf('contenteditable="false"')!==-1)return b}}return''+a.dom.encode("string"==typeof c[1]?c[1]:c[0])+""}var e=g.length,h=c.content,i=b.trim(f);if("raw"!=c.format){for(;e--;)h=h.replace(g[e],d);c.content=h}}var e,f,g,h="contenteditable";e=" "+b.trim(a.getParam("noneditable_editable_class","mceEditable"))+" ",f=" "+b.trim(a.getParam("noneditable_noneditable_class","mceNonEditable"))+" ";var i=c(e),j=c(f);g=a.getParam("noneditable_regexp"),g&&!g.length&&(g=[g]),a.on("PreInit",function(){g&&a.on("BeforeSetContent",d),a.parser.addAttributeFilter("class",function(a){for(var b,c=a.length;c--;)b=a[c],i(b)?b.attr(h,"true"):j(b)&&b.attr(h,"false")}),a.serializer.addAttributeFilter(h,function(a){for(var b,c=a.length;c--;)b=a[c],(i(b)||j(b))&&(g&&b.attr("data-mce-content")?(b.name="#text",b.type=3,b.raw=!0,b.value=b.attr("data-mce-content")):b.attr(h,null))})})}),function(){}}),d("0")()}();
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Scripts/tinymce/plugins/pagebreak/plugin.min.js:
--------------------------------------------------------------------------------
1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i"),e=new RegExp(d.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(a){return"\\"+a}),"gi"),f='
';a.addCommand("mcePageBreak",function(){a.settings.pagebreak_split_block?a.insertContent(""+f+"
"):a.insertContent(f)}),a.addButton("pagebreak",{title:"Page break",cmd:"mcePageBreak"}),a.addMenuItem("pagebreak",{text:"Page break",icon:"pagebreak",cmd:"mcePageBreak",context:"insert"}),a.on("ResolveName",function(b){"IMG"==b.target.nodeName&&a.dom.hasClass(b.target,c)&&(b.name="pagebreak")}),a.on("click",function(b){b=b.target,"IMG"===b.nodeName&&a.dom.hasClass(b,c)&&a.selection.select(b)}),a.on("BeforeSetContent",function(a){a.content=a.content.replace(e,f)}),a.on("PreInit",function(){a.serializer.addNodeFilter("img",function(b){for(var c,e,f=b.length;f--;)if(c=b[f],e=c.attr("class"),e&&e.indexOf("mce-pagebreak")!==-1){var g=c.parent;if(a.schema.getBlockElements()[g.name]&&a.settings.pagebreak_split_block){g.type=3,g.value=d,g.raw=!0,c.remove();continue}c.type=3,c.value=d,c.raw=!0}})})}),function(){}}),d("0")()}();
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Scripts/tinymce/plugins/preview/plugin.min.js:
--------------------------------------------------------------------------------
1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i",buttons:{text:"Close",onclick:function(){this.parent().parent().close()}},onPostRender:function(){var b,f="",g=a.dom.encode;f+='',c.each(a.contentCSS,function(b){f+=''});var h=d.body_id||"tinymce";h.indexOf("=")!=-1&&(h=a.getParam("body_id","","hash"),h=h[a.id]||h);var i=d.body_class||"";i.indexOf("=")!=-1&&(i=a.getParam("body_class","","hash"),i=i[a.id]||"");var j=' ',k=a.settings.directionality?' dir="'+a.settings.directionality+'"':"";if(b=""+f+'"+a.getContent()+j+"",e)this.getEl("body").firstChild.src="data:text/html;charset=utf-8,"+encodeURIComponent(b);else{var l=this.getEl("body").firstChild.contentWindow.document;l.open(),l.write(b),l.close()}}})}),a.addButton("preview",{title:"Preview",cmd:"mcePreview"}),a.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})}),function(){}}),d("0")()}();
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Scripts/tinymce/plugins/print/plugin.min.js:
--------------------------------------------------------------------------------
1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i0){for(l=h+1;l=0;l--)if(g(j[l]))return j[l];return null}var h,j,k,l;if(!(9!==b.keyCode||b.ctrlKey||b.altKey||b.metaKey||b.isDefaultPrevented())&&(k=c.explode(a.getParam("tab_focus",a.getParam("tabfocus_elements",":prev,:next"))),1==k.length&&(k[1]=k[0],k[0]=":prev"),j=b.shiftKey?":prev"==k[0]?g(-1):i.get(k[0]):":next"==k[1]?g(1):i.get(k[1]))){var m=d.get(j.id||j.name);j.id&&m?m.focus():e.setTimeout(function(){f.webkit||window.focus(),j.focus()},10),b.preventDefault()}}var i=b.DOM;a.on("init",function(){a.inline&&i.setAttrib(a.getBody(),"tabIndex",null),a.on("keyup",g),f.gecko?a.on("keypress keydown",h):a.on("keydown",h)})}),function(){}}),d("0")()}();
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Scripts/tinymce/plugins/visualblocks/plugin.min.js:
--------------------------------------------------------------------------------
1 | !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i Providers { get; set; }
11 |
12 | public string ReturnUrl { get; set; }
13 |
14 | public bool RememberMe { get; set; }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/ViewModels/Account/VerifyCodeViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web.ViewModels.Account
2 | {
3 | using System.ComponentModel.DataAnnotations;
4 |
5 | public class VerifyCodeViewModel
6 | {
7 | [Required]
8 | public string Provider { get; set; }
9 |
10 | [Required]
11 | [Display(Name = "Code")]
12 | public string Code { get; set; }
13 |
14 | public string ReturnUrl { get; set; }
15 |
16 | [Display(Name = "Remember this browser?")]
17 | public bool RememberBrowser { get; set; }
18 |
19 | public bool RememberMe { get; set; }
20 | }
21 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/ViewModels/BaseViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web.ViewModels
2 | {
3 | using System;
4 | using System.ComponentModel.DataAnnotations;
5 |
6 | public class BaseViewModel
7 | {
8 | [DisplayFormat(DataFormatString = "{0:dd MMMM yyyy}")]
9 | public DateTime CreatedOn { get; set; }
10 | }
11 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/ViewModels/Comments/CommentViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web.ViewModels.Comments
2 | {
3 | using System.Web.Mvc;
4 | using System.ComponentModel.DataAnnotations;
5 |
6 | using AutoMapper;
7 |
8 | using BlogSystem.Data.Models;
9 | using BlogSystem.Web.Infrastructure.Mapping;
10 |
11 | public class CommentViewModel : BaseViewModel, IMapFrom, IHaveCustomMappings
12 | {
13 | public int Id { get; set; }
14 |
15 | [AllowHtml]
16 | [UIHint("TinyMCE")]
17 | public string Content { get; set; }
18 |
19 | public string Author { get; set; }
20 |
21 | public void CreateMappings(IMapperConfigurationExpression config)
22 | {
23 | config.CreateMap().ForMember(m => m.Author, c => c.MapFrom(comment => comment.Author.UserName));
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/ViewModels/Home/IndexPageViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web.ViewModels.Home
2 | {
3 | using System.Collections.Generic;
4 |
5 | using BlogSystem.Web.ViewModels;
6 |
7 | public class IndexPageViewModel : PaginationViewModel
8 | {
9 | public IEnumerable Posts { get; set; }
10 | }
11 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/ViewModels/Home/PostConciseViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web.ViewModels.Home
2 | {
3 | using AutoMapper;
4 |
5 | using BlogSystem.Data.Models;
6 | using BlogSystem.Web.Infrastructure.Mapping;
7 |
8 | public class PostConciseViewModel : BaseViewModel, IMapFrom, IHaveCustomMappings
9 | {
10 | public int Id { get; set; }
11 |
12 | public string Title { get; set; }
13 |
14 | public string Content { get; set; }
15 |
16 | public string Slug { get; set; }
17 |
18 | public string Author { get; set; }
19 |
20 | public void CreateMappings(IMapperConfigurationExpression config)
21 | {
22 | config.CreateMap().ForMember(m => m.Author, c => c.MapFrom(post => post.Author.UserName));
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/ViewModels/Manage/AddPhoneNumberViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web.ViewModels.Manage
2 | {
3 | using System.ComponentModel.DataAnnotations;
4 |
5 | public class AddPhoneNumberViewModel
6 | {
7 | [Required]
8 | [Phone]
9 | [Display(Name = "Phone Number")]
10 | public string Number { get; set; }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/ViewModels/Manage/ChangePasswordViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web.ViewModels.Manage
2 | {
3 | using System.ComponentModel.DataAnnotations;
4 |
5 | public class ChangePasswordViewModel
6 | {
7 | [Required]
8 | [DataType(DataType.Password)]
9 | [Display(Name = "Current password")]
10 | public string OldPassword { get; set; }
11 |
12 | [Required]
13 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
14 | [DataType(DataType.Password)]
15 | [Display(Name = "New password")]
16 | public string NewPassword { get; set; }
17 |
18 | [DataType(DataType.Password)]
19 | [Display(Name = "Confirm new password")]
20 | [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
21 | public string ConfirmPassword { get; set; }
22 | }
23 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/ViewModels/Manage/ConfigureTwoFactorViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web.ViewModels.Manage
2 | {
3 | using System.Collections.Generic;
4 | using System.Web.Mvc;
5 |
6 | public class ConfigureTwoFactorViewModel
7 | {
8 | public string SelectedProvider { get; set; }
9 |
10 | public ICollection Providers { get; set; }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/ViewModels/Manage/ExternalLoginListViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web.ViewModels.Manage
2 | {
3 | public class ExternalLoginListViewModel
4 | {
5 | public string ReturnUrl { get; set; }
6 | }
7 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/ViewModels/Manage/FactorViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web.ViewModels.Manage
2 | {
3 | public class FactorViewModel
4 | {
5 | public string Purpose { get; set; }
6 | }
7 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/ViewModels/Manage/IndexViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web.ViewModels.Manage
2 | {
3 | using System.Collections.Generic;
4 | using Microsoft.AspNet.Identity;
5 |
6 | public class IndexViewModel
7 | {
8 | public bool HasPassword { get; set; }
9 |
10 | public IList Logins { get; set; }
11 |
12 | public string PhoneNumber { get; set; }
13 |
14 | public bool TwoFactor { get; set; }
15 |
16 | public bool BrowserRemembered { get; set; }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/ViewModels/Manage/ManageLoginsViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web.ViewModels.Manage
2 | {
3 | using System.Collections.Generic;
4 | using Microsoft.AspNet.Identity;
5 | using Microsoft.Owin.Security;
6 |
7 | public class ManageLoginsViewModel
8 | {
9 | public IList CurrentLogins { get; set; }
10 |
11 | public IList OtherLogins { get; set; }
12 | }
13 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/ViewModels/Manage/SetPasswordViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web.ViewModels.Manage
2 | {
3 | using System.ComponentModel.DataAnnotations;
4 |
5 | public class SetPasswordViewModel
6 | {
7 | [Required]
8 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
9 | [DataType(DataType.Password)]
10 | [Display(Name = "New password")]
11 | public string NewPassword { get; set; }
12 |
13 | [DataType(DataType.Password)]
14 | [Display(Name = "Confirm new password")]
15 | [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
16 | public string ConfirmPassword { get; set; }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/ViewModels/Manage/UserAvatarViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web.ViewModels.Manage
2 | {
3 | using System.Web;
4 |
5 | public class UserAvatarViewModel
6 | {
7 | public HttpPostedFileBase Avatar { get; set; }
8 | }
9 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/ViewModels/Manage/VerifyPhoneNumberViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web.ViewModels.Manage
2 | {
3 | using System.ComponentModel.DataAnnotations;
4 |
5 | public class VerifyPhoneNumberViewModel
6 | {
7 | [Required]
8 | [Display(Name = "Code")]
9 | public string Code { get; set; }
10 |
11 | [Required]
12 | [Phone]
13 | [Display(Name = "Phone Number")]
14 | public string PhoneNumber { get; set; }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/ViewModels/MenuItemViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web.ViewModels
2 | {
3 | using BlogSystem.Data.Models;
4 | using BlogSystem.Web.Infrastructure.Mapping;
5 |
6 | public class MenuItemViewModel : IMapFrom
7 | {
8 | public int Id { get; set; }
9 |
10 | public string Title { get; set; }
11 |
12 | public string Slug { get; set; }
13 | }
14 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/ViewModels/Pages/PageViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web.ViewModels.Pages
2 | {
3 | using AutoMapper;
4 |
5 | using BlogSystem.Data.Models;
6 | using BlogSystem.Web.Infrastructure.Mapping;
7 |
8 | public class PageViewModel : BaseViewModel, IMapFrom, IHaveCustomMappings
9 | {
10 | public int Id { get; set; }
11 |
12 | public string Title { get; set; }
13 |
14 | public string Content { get; set; }
15 |
16 | public string Slug { get; set; }
17 |
18 | public string Author { get; set; }
19 |
20 | public void CreateMappings(IMapperConfigurationExpression configuration)
21 | {
22 | configuration.CreateMap().ForMember(model => model.Author, config => config.MapFrom(page => page.Author.UserName));
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/ViewModels/PaginationViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web.ViewModels
2 | {
3 | public class PaginationViewModel
4 | {
5 | public int PagesCount { get; set; }
6 |
7 | public int CurrentPage { get; set; }
8 |
9 | public int NextPage
10 | {
11 | get
12 | {
13 | if (this.CurrentPage >= this.PagesCount)
14 | {
15 | return 1;
16 | }
17 |
18 | return this.CurrentPage + 1;
19 | }
20 | }
21 |
22 | public int PreviousPage
23 | {
24 | get
25 | {
26 | if (this.CurrentPage <= 1)
27 | {
28 | return this.PagesCount;
29 | }
30 |
31 | return this.CurrentPage - 1;
32 | }
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/ViewModels/Posts/PostViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web.ViewModels.Posts
2 | {
3 | using AutoMapper;
4 |
5 | using BlogSystem.Data.Models;
6 | using BlogSystem.Web.Infrastructure.Mapping;
7 |
8 | public class PostViewModel : BaseViewModel, IMapFrom, IHaveCustomMappings
9 | {
10 | public int Id { get; set; }
11 |
12 | public string Title { get; set; }
13 |
14 | public string Content { get; set; }
15 |
16 | public string Slug { get; set; }
17 |
18 | public string Author { get; set; }
19 |
20 | public void CreateMappings(IMapperConfigurationExpression config)
21 | {
22 | config.CreateMap().ForMember(m => m.Author, c => c.MapFrom(post => post.Author.UserName));
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/ViewModels/SidebarViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace BlogSystem.Web.ViewModels
2 | {
3 | using System.Collections.Generic;
4 |
5 | using BlogSystem.Web.ViewModels.Posts;
6 | using BlogSystem.Web.ViewModels.Pages;
7 |
8 | public class SidebarViewModel
9 | {
10 | public IEnumerable RecentPosts { get; set; }
11 |
12 | public IEnumerable AllPages { get; set; }
13 | }
14 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Account/ConfirmEmail.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Confirm Email";
3 | }
4 |
5 | @ViewBag.Title.
6 |
7 |
8 | Thank you for confirming your email. Please @Html.ActionLink("Click here to Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Account/ExternalLoginConfirmation.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.ViewModels.Account.ExternalLoginConfirmationViewModel
2 | @{
3 | ViewBag.Title = "Register";
4 | }
5 | @ViewBag.Title.
6 | Associate your @ViewBag.LoginProvider account.
7 |
8 | @using (Html.BeginForm("ExternalLoginConfirmation", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
9 | {
10 | @Html.AntiForgeryToken()
11 |
12 | Association Form
13 |
14 | @Html.ValidationSummary(true, "", new { @class = "text-danger" })
15 |
16 | You've successfully authenticated with @ViewBag.LoginProvider.
17 | Please enter a user name for this site below and click the Register button to finish
18 | logging in.
19 |
20 |
27 |
32 | }
33 |
34 | @section Scripts {
35 | @Scripts.Render("~/bundles/jqueryval")
36 | }
37 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Account/ExternalLoginFailure.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Login Failure";
3 | }
4 |
5 |
6 | @ViewBag.Title.
7 | Unsuccessful login with service.
8 |
9 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Account/ForgotPassword.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.ViewModels.Account.ForgotPasswordViewModel
2 | @{
3 | ViewBag.Title = "Forgot your password?";
4 | }
5 |
6 | @ViewBag.Title.
7 |
8 | @using (Html.BeginForm("ForgotPassword", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
9 | {
10 | @Html.AntiForgeryToken()
11 | Enter your email.
12 |
13 | @Html.ValidationSummary("", new { @class = "text-danger" })
14 |
20 |
25 | }
26 |
27 | @section Scripts {
28 | @Scripts.Render("~/bundles/jqueryval")
29 | }
30 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Account/ForgotPasswordConfirmation.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Forgot Password Confirmation";
3 | }
4 |
5 |
6 | @ViewBag.Title.
7 |
8 |
9 |
10 | Please check your email to reset your password.
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Account/Login.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.ViewModels.Account.LoginViewModel
2 |
3 | @{
4 | ViewBag.Title = "Log in";
5 | }
6 |
7 |
8 |
11 |
12 |
13 | @using (Html.BeginForm("Login", "Account", new { ViewBag.ReturnUrl }, FormMethod.Post))
14 | {
15 | @Html.AntiForgeryToken()
16 | @Html.ValidationSummary(true, string.Empty, new { @class = "text-danger" })
17 |
18 |
26 |
27 |
35 |
36 |
42 |
43 |
44 |
45 |
46 | }
47 |
48 |
49 |
50 | @section Scripts {
51 | @Scripts.Render("~/bundles/jqueryval")
52 | }
53 |
54 | @*Enable this once you have account confirmation enabled for password reset functionality
55 |
56 | @Html.ActionLink("Forgot your password?", "ForgotPassword")
57 |
*@
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Account/Register.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.ViewModels.Account.RegisterViewModel
2 |
3 | @{
4 | ViewBag.Title = "Register";
5 | }
6 |
7 |
8 |
11 |
12 |
13 | @using (Html.BeginForm("Register", "Account", FormMethod.Post, new { enctype = "multipart/form-data" }))
14 | {
15 | @Html.AntiForgeryToken()
16 | @Html.ValidationSummary(string.Empty, new { @class = "text-danger" })
17 |
18 |
25 |
26 |
33 |
34 |
41 |
42 |
49 |
50 |
51 |
52 |
53 | }
54 |
55 |
56 |
57 |
58 | @section Scripts {
59 | @Scripts.Render("~/bundles/jqueryval")
60 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Account/ResetPassword.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.ViewModels.Account.ResetPasswordViewModel
2 | @{
3 | ViewBag.Title = "Reset password";
4 | }
5 |
6 | @ViewBag.Title.
7 |
8 | @using (Html.BeginForm("ResetPassword", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
9 | {
10 | @Html.AntiForgeryToken()
11 | Reset your password.
12 |
13 | @Html.ValidationSummary("", new { @class = "text-danger" })
14 | @Html.HiddenFor(model => model.Code)
15 |
21 |
27 |
33 |
38 | }
39 |
40 | @section Scripts {
41 | @Scripts.Render("~/bundles/jqueryval")
42 | }
43 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Account/ResetPasswordConfirmation.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Reset password confirmation";
3 | }
4 |
5 |
6 | @ViewBag.Title.
7 |
8 |
9 |
10 | Your password has been reset. Please @Html.ActionLink("click here to log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Account/SendCode.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.ViewModels.Account.SendCodeViewModel
2 | @{
3 | ViewBag.Title = "Send";
4 | }
5 |
6 | @ViewBag.Title.
7 |
8 | @using (Html.BeginForm("SendCode", "Account", new { ReturnUrl = Model.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) {
9 | @Html.AntiForgeryToken()
10 | @Html.Hidden("rememberMe", @Model.RememberMe)
11 | Send verification code
12 |
13 |
14 |
15 | Select Two-Factor Authentication Provider:
16 | @Html.DropDownListFor(model => model.SelectedProvider, Model.Providers)
17 |
18 |
19 |
20 | }
21 |
22 | @section Scripts {
23 | @Scripts.Render("~/bundles/jqueryval")
24 | }
25 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Account/VerifyCode.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.ViewModels.Account.VerifyCodeViewModel
2 | @{
3 | ViewBag.Title = "Verify";
4 | }
5 |
6 | @ViewBag.Title.
7 |
8 | @using (Html.BeginForm("VerifyCode", "Account", new { ReturnUrl = Model.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) {
9 | @Html.AntiForgeryToken()
10 | @Html.Hidden("provider", @Model.Provider)
11 | @Html.Hidden("rememberMe", @Model.RememberMe)
12 | Enter verification code
13 |
14 | @Html.ValidationSummary("", new { @class = "text-danger" })
15 |
21 |
29 |
34 | }
35 |
36 | @section Scripts {
37 | @Scripts.Render("~/bundles/jqueryval")
38 | }
39 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Account/_ExternalLoginsListPartial.cshtml:
--------------------------------------------------------------------------------
1 | @using System.Linq
2 | @using System.Web
3 | @using Microsoft.Owin.Security
4 | @model BlogSystem.Web.ViewModels.Manage.ExternalLoginListViewModel
5 |
6 | Use another service to log in.
7 |
8 | @{
9 | var loginProviders = Context.GetOwinContext().Authentication.GetExternalAuthenticationTypes();
10 | if (loginProviders.Count() == 0)
11 | {
12 |
13 |
14 | There are no external authentication services configured. See this article
15 | for details on setting up this ASP.NET application to support logging in via external services.
16 |
17 |
18 | }
19 | else
20 | {
21 | using (Html.BeginForm("ExternalLogin", "Account", new { Model.ReturnUrl }))
22 | {
23 | @Html.AntiForgeryToken()
24 |
25 |
26 | @foreach (AuthenticationDescription p in loginProviders)
27 | {
28 |
29 | }
30 |
31 |
32 | }
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Blog/Page.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.ViewModels.Pages.PageViewModel
2 |
3 | @{
4 | ViewBag.Title = Model.Title;
5 | }
6 |
7 |
8 |
15 |
16 |
17 | @Html.Raw(Model.Content)
18 |
19 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Blog/Post.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.ViewModels.Posts.PostViewModel
2 |
3 | @using BlogSystem.Web.ViewModels.Comments
4 |
5 | @{
6 | ViewBag.Title = Model.Title;
7 |
8 | const string commentsPartialViewsFolder = "~/Views/Comments/{0}.cshtml";
9 | }
10 |
11 |
12 |
19 |
20 |
21 | @Html.Raw(Model.Content)
22 |
23 |
24 |
49 |
50 |
51 | @section Scripts {
52 | @Scripts.Render("~/bundles/notify")
53 | @Scripts.Render("~/bundles/jqueryajax")
54 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Blog/_Menu.cshtml:
--------------------------------------------------------------------------------
1 | @model IEnumerable
2 |
3 |
4 | -
5 | @Html.ActionLink("Home", "Index", "Home", new { area = string.Empty }, new { @class = "nav-link" })
6 |
7 |
8 | @foreach (var page in Model)
9 | {
10 | -
11 | @Html.RouteLink(page.Title, "Pages", new { slug = page.Slug, id = page.Id }, new { @class = "nav-link" })
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Blog/_Sidebar.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.ViewModels.SidebarViewModel
2 |
3 |
19 |
20 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Comments/All.cshtml:
--------------------------------------------------------------------------------
1 | @model IEnumerable
2 |
3 | @if (Model.Any())
4 | {
5 |
22 | }
23 | else
24 | {
25 |
28 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Comments/_CreateComment.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.ViewModels.Comments.CommentViewModel
2 |
3 | Leave a Comment
4 |
5 | @if (User.Identity.IsAuthenticated)
6 | {
7 | using (Ajax.BeginForm("Create", "Comments",
8 | new { id = this.ViewData["id"] },
9 | new AjaxOptions
10 | {
11 | HttpMethod = "Post",
12 | InsertionMode = InsertionMode.Replace,
13 | UpdateTargetId = "comments",
14 | OnFailure = "BlogSystem.onCreateCommentFailure",
15 | OnSuccess = "BlogSystem.onAddCommentSuccess"
16 | }))
17 | {
18 | @Html.AntiForgeryToken()
19 | @Html.ValidationSummary(true, string.Empty, new { @class = "text-danger" })
20 |
21 |
22 | @Html.EditorFor(m => m.Content, new { htmlAttributes = new { @class = "form-control " } })
23 | @Html.ValidationMessageFor(m => m.Content, string.Empty, new { @class = "text-danger" })
24 |
25 |
26 |
27 | }
28 | }
29 | else
30 | {
31 | Only registered users can comment.
32 | }
33 |
34 | @section Scripts {
35 | @Scripts.Render("~/bundles/jqueryval")
36 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Home/Index.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.ViewModels.Home.IndexPageViewModel
2 |
3 | @{
4 | ViewBag.Title = "Home";
5 | }
6 |
7 | @if (Model.Posts.Any())
8 | {
9 | foreach (var post in Model.Posts)
10 | {
11 |
12 |
21 |
22 |
23 | @Html.Truncate(post.Content)
24 |
25 |
26 | }
27 | }
28 | else
29 | {
30 |
31 | Error
32 | Sorry, nothing here...
33 |
34 | }
35 |
36 | @Html.Partial("_Pagination")
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Manage/AddPhoneNumber.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.ViewModels.Manage.AddPhoneNumberViewModel
2 | @{
3 | ViewBag.Title = "Phone Number";
4 | }
5 |
6 | @ViewBag.Title.
7 |
8 | @using (Html.BeginForm("AddPhoneNumber", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
9 | {
10 | @Html.AntiForgeryToken()
11 | Add a phone number
12 |
13 | @Html.ValidationSummary("", new { @class = "text-danger" })
14 |
20 |
25 | }
26 |
27 | @section Scripts {
28 | @Scripts.Render("~/bundles/jqueryval")
29 | }
30 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Manage/ChangePassword.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.ViewModels.Manage.ChangePasswordViewModel
2 |
3 | @{
4 | ViewBag.Title = "Change Password";
5 | }
6 |
7 |
8 |
11 |
12 |
13 |
@ViewBag.Title
14 |
15 | @using (Html.BeginForm("ChangePassword", "Manage", FormMethod.Post))
16 | {
17 | @Html.AntiForgeryToken()
18 | @Html.ValidationSummary(string.Empty, new { @class = "text-danger" })
19 |
20 |
27 |
28 |
35 |
36 |
43 |
44 |
45 |
46 |
47 | }
48 |
49 |
50 |
51 | @section Scripts {
52 | @Scripts.Render("~/bundles/jqueryval")
53 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Manage/Index.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.ViewModels.Manage.IndexViewModel
2 |
3 | @using Microsoft.AspNet.Identity
4 |
5 | @{
6 | ViewBag.Title = "Manage Account";
7 | }
8 |
9 |
10 |
13 |
14 |
15 |
16 | You're logged in as @User.Identity.GetUserName()
17 |
18 |
19 | @if (Model.HasPassword)
20 | {
21 | @Html.ActionLink("Change password", "ChangePassword", new { area = string.Empty }, new { @class = "btn btn-warning" })
22 | }
23 | else
24 | {
25 | @Html.ActionLink("Create", "SetPassword")
26 | }
27 |
28 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Manage/SetPassword.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.ViewModels.Manage.SetPasswordViewModel
2 | @{
3 | ViewBag.Title = "Create Password";
4 | }
5 |
6 | @ViewBag.Title.
7 |
8 | You do not have a local username/password for this site. Add a local
9 | account so you can log in without an external login.
10 |
11 |
12 | @using (Html.BeginForm("SetPassword", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
13 | {
14 | @Html.AntiForgeryToken()
15 |
16 | Create Local Login
17 |
18 | @Html.ValidationSummary("", new { @class = "text-danger" })
19 |
25 |
31 |
36 | }
37 | @section Scripts {
38 | @Scripts.Render("~/bundles/jqueryval")
39 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Manage/VerifyPhoneNumber.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.ViewModels.Manage.VerifyPhoneNumberViewModel
2 | @{
3 | ViewBag.Title = "Verify Phone Number";
4 | }
5 |
6 | @ViewBag.Title.
7 |
8 | @using (Html.BeginForm("VerifyPhoneNumber", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
9 | {
10 | @Html.AntiForgeryToken()
11 | @Html.Hidden("phoneNumber", @Model.PhoneNumber)
12 | Enter verification code
13 | @ViewBag.Status
14 |
15 | @Html.ValidationSummary("", new { @class = "text-danger" })
16 |
22 |
27 | }
28 |
29 | @section Scripts {
30 | @Scripts.Render("~/bundles/jqueryval")
31 | }
32 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Shared/EditorTemplates/TinyMCE.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
19 |
20 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Shared/Error.cshtml:
--------------------------------------------------------------------------------
1 | @model System.Web.Mvc.HandleErrorInfo
2 |
3 | @{
4 | ViewBag.Title = "Error";
5 | }
6 |
7 | Error.
8 | An error occurred while processing your request.
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Shared/Lockout.cshtml:
--------------------------------------------------------------------------------
1 | @model System.Web.Mvc.HandleErrorInfo
2 |
3 | @{
4 | ViewBag.Title = "Locked Out";
5 | }
6 |
7 |
8 | Locked out.
9 | This account has been locked out, please try again later.
10 |
11 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Shared/_Footer.cshtml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Shared/_Header.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 | @ViewData["Blog_Title"]
4 | @ViewData["Blog_Description"]
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Shared/_Layout.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | @ViewBag.Title - @ViewData["Blog_Title"]
16 |
17 |
18 |
19 | @Styles.Render("~/Content/bootstrap")
20 | @Styles.Render("~/Content/tether")
21 | @Styles.Render("~/Content/fonts")
22 | @Styles.Render("~/Content/blog")
23 |
24 |
25 |
26 |
27 | @Html.Partial("_Header")
28 |
29 |
30 |
31 |
32 | @{ Html.RenderAction("Sidebar", "Blog"); }
33 |
34 |
35 | @RenderBody()
36 |
37 |
38 |
39 |
40 | @Html.Partial("_Footer")
41 |
42 | @Scripts.Render("~/bundles/jquery")
43 | @Scripts.Render("~/bundles/tether")
44 | @Scripts.Render("~/bundles/bootstrap")
45 | @Scripts.Render("~/bundles/blog")
46 |
47 |
48 |
49 | @RenderSection("scripts", false)
50 |
51 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Shared/_LoginPartial.cshtml:
--------------------------------------------------------------------------------
1 | @using BlogSystem.Common
2 |
3 |
4 | @if (Request.IsAuthenticated)
5 | {
6 | -
7 |
8 | Hello @User.Identity.Name
9 |
10 |
25 |
26 | }
27 | else
28 | {
29 | -
30 | @Html.ActionLink("Register", "Register", "Account", new { area = string.Empty }, new { @class = "btn btn-outline-success my-2 my-sm-0", id = "registerLink" })
31 |
32 | -
33 | @Html.ActionLink("Log in", "Login", "Account", new { area = string.Empty }, new { @class = "btn btn-outline-success my-2 my-sm-0", id = "loginLink" })
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Shared/_LoginRegisterPartial.cshtml:
--------------------------------------------------------------------------------
1 |
2 | @Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink", @class = "btn btn-success" })
3 | @Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink", @class = "btn btn-primary" })
4 |
5 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Shared/_Pagination.cshtml:
--------------------------------------------------------------------------------
1 | @model BlogSystem.Web.ViewModels.PaginationViewModel
2 |
3 | @if (Model.PagesCount > 1)
4 | {
5 |
39 | }
40 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "~/Views/Shared/_Layout.cshtml";
3 | }
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/BlogSystem.Web/fonts/FontAwesome.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ivanovx/BlogSystem/b5cc738df8e8b8acc1dca0d8ef80a72204092426/src/BlogSystem.Web/fonts/FontAwesome.otf
--------------------------------------------------------------------------------
/src/BlogSystem.Web/fonts/customicon/Icons.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ivanovx/BlogSystem/b5cc738df8e8b8acc1dca0d8ef80a72204092426/src/BlogSystem.Web/fonts/customicon/Icons.eot
--------------------------------------------------------------------------------
/src/BlogSystem.Web/fonts/customicon/Icons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ivanovx/BlogSystem/b5cc738df8e8b8acc1dca0d8ef80a72204092426/src/BlogSystem.Web/fonts/customicon/Icons.ttf
--------------------------------------------------------------------------------
/src/BlogSystem.Web/fonts/customicon/Icons.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ivanovx/BlogSystem/b5cc738df8e8b8acc1dca0d8ef80a72204092426/src/BlogSystem.Web/fonts/customicon/Icons.woff
--------------------------------------------------------------------------------
/src/BlogSystem.Web/fonts/fontawesome-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ivanovx/BlogSystem/b5cc738df8e8b8acc1dca0d8ef80a72204092426/src/BlogSystem.Web/fonts/fontawesome-webfont.eot
--------------------------------------------------------------------------------
/src/BlogSystem.Web/fonts/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ivanovx/BlogSystem/b5cc738df8e8b8acc1dca0d8ef80a72204092426/src/BlogSystem.Web/fonts/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/src/BlogSystem.Web/fonts/fontawesome-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ivanovx/BlogSystem/b5cc738df8e8b8acc1dca0d8ef80a72204092426/src/BlogSystem.Web/fonts/fontawesome-webfont.woff
--------------------------------------------------------------------------------
/src/BlogSystem.Web/fonts/fontawesome-webfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ivanovx/BlogSystem/b5cc738df8e8b8acc1dca0d8ef80a72204092426/src/BlogSystem.Web/fonts/fontawesome-webfont.woff2
--------------------------------------------------------------------------------
/src/BlogSystem.Web/images/header.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ivanovx/BlogSystem/b5cc738df8e8b8acc1dca0d8ef80a72204092426/src/BlogSystem.Web/images/header.jpg
--------------------------------------------------------------------------------
/src/BlogSystem.Web/images/old-header.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ivanovx/BlogSystem/b5cc738df8e8b8acc1dca0d8ef80a72204092426/src/BlogSystem.Web/images/old-header.jpg
--------------------------------------------------------------------------------
/src/BlogSystem.Web/robots.txt:
--------------------------------------------------------------------------------
1 | User-Agent: *
2 | Allow: /
--------------------------------------------------------------------------------
Comments
7 | 8 | @foreach (var comment in Model) 9 | { 10 |