|
15 | 15 | user = "0"; |
16 | 16 | } |
17 | 17 | var postListStyle = "grid"; |
18 | | - if(Model.CustomFields.ContainsKey(Constants.PostListStyle)) |
| 18 | + if (Model.CustomFields.ContainsKey(Constants.PostListStyle)) |
19 | 19 | { |
20 | 20 | postListStyle = Model.CustomFields["PostListStyle"]; |
21 | 21 | } |
|
31 | 31 | } |
32 | 32 |
|
33 | 33 | var qs = ""; |
34 | | - if(user != "0") |
| 34 | + if (user != "0") |
35 | 35 | { |
36 | 36 | qs += $"&user={user}"; |
37 | 37 | } |
|
55 | 55 | <div class="bf-toolbar d-flex"> |
56 | 56 | <label class="custom-control custom-checkbox my-auto mr-3" data-tooltip title="Select All"><input class="custom-control-input item-checkbox" type="checkbox" name="selectAll"><span class="item-control custom-control-indicator"></span></label> |
57 | 57 | <div id="postActionButtons" class="btn-group mr-3"> |
58 | | - <button type="button" class="btn btn-outline-secondary btn-icon btn-sm btn-rounded" disabled="disabled" data-tooltip onclick="return postsController.removePost()" title="Delete"><i class="fa fa-trash"></i></button> |
59 | | - <button type="button" class="btn btn-outline-secondary btn-icon btn-sm btn-rounded" disabled="disabled" data-tooltip onclick="return postsController.unpublish()" title="Unpublish"><i class="fa fa-archive"></i></button> |
60 | | - <button type="button" class="btn btn-outline-secondary btn-icon btn-sm btn-rounded" disabled="disabled" data-tooltip onclick="return postsController.publish()" title="Publish"><i class="fa fa-check"></i></button> |
| 58 | + <button type="button" class="btn btn-outline-secondary btn-icon btn-sm btn-rounded" disabled="disabled" data-tooltip onclick="return postsController.removePost()" title="Delete"><i class="fa fa-trash"></i></button> |
| 59 | + <button type="button" class="btn btn-outline-secondary btn-icon btn-sm btn-rounded" disabled="disabled" data-tooltip onclick="return postsController.unpublish()" title="Unpublish"><i class="fa fa-archive"></i></button> |
| 60 | + <button type="button" class="btn btn-outline-secondary btn-icon btn-sm btn-rounded" disabled="disabled" data-tooltip onclick="return postsController.publish()" title="Publish"><i class="fa fa-check"></i></button> |
61 | 61 | </div> |
62 | 62 | <div class="loading loading-sm mr-3"><div class="loading-dot-1"></div><div class="loading-dot-2"></div><div class="loading-dot-3"></div></div> |
63 | 63 | <div class="dropdown dropdown-custom ml-auto mr-3 d-none d-lg-block"> |
64 | | - <button class="btn btn-sm btn-outline-secondary btn-rounded dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
65 | | - <span class="dropdown-value">@postListSize</span> Posts |
66 | | - </button> |
67 | | - <div class="dropdown-menu dropdown-menu-wide" aria-labelledby="dropdownMenuButton"> |
68 | | - <button class="dropdown-item" type="button" onclick="postsController.selectListSize('10')">10</button> |
69 | | - <button class="dropdown-item" type="button" onclick="postsController.selectListSize('20')">20</button> |
70 | | - <button class="dropdown-item" type="button" onclick="postsController.selectListSize('30')">30</button> |
71 | | - <button class="dropdown-item" type="button" onclick="postsController.selectListSize('40')">40</button> |
72 | | - <button class="dropdown-item" type="button" onclick="postsController.selectListSize('50')">50</button> |
73 | | - </div> |
| 64 | + <button class="btn btn-sm btn-outline-secondary btn-rounded dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
| 65 | + <span class="dropdown-value">@postListSize</span> Posts |
| 66 | + </button> |
| 67 | + <div class="dropdown-menu dropdown-menu-wide" aria-labelledby="dropdownMenuButton"> |
| 68 | + <button class="dropdown-item" type="button" onclick="postsController.selectListSize('10')">10</button> |
| 69 | + <button class="dropdown-item" type="button" onclick="postsController.selectListSize('20')">20</button> |
| 70 | + <button class="dropdown-item" type="button" onclick="postsController.selectListSize('30')">30</button> |
| 71 | + <button class="dropdown-item" type="button" onclick="postsController.selectListSize('40')">40</button> |
| 72 | + <button class="dropdown-item" type="button" onclick="postsController.selectListSize('50')">50</button> |
| 73 | + </div> |
74 | 74 | </div> |
75 | 75 | <div class="btn-group ml-auto ml-lg-0"> |
76 | | - <button id="post-list-btn" type="button" class="btn btn-outline-secondary btn-icon btn-sm btn-rounded @listBtnStyle" data-tooltip onclick="postsController.togglePostView('list')" title="List style"><i class="fa fa-list"></i></button> |
77 | | - <button id="post-grid-btn" type="button" class="btn btn-outline-secondary btn-icon btn-sm btn-rounded @gridBtnStyle" data-tooltip onclick="postsController.togglePostView('grid')" title="Grid style"><i class="fa fa-th"></i></button> |
| 76 | + <button id="post-list-btn" type="button" class="btn btn-outline-secondary btn-icon btn-sm btn-rounded @listBtnStyle" data-tooltip onclick="postsController.togglePostView('list')" title="List style"><i class="fa fa-list"></i></button> |
| 77 | + <button id="post-grid-btn" type="button" class="btn btn-outline-secondary btn-icon btn-sm btn-rounded @gridBtnStyle" data-tooltip onclick="postsController.togglePostView('grid')" title="Grid style"><i class="fa fa-th"></i></button> |
78 | 78 | </div> |
79 | 79 | </div> |
80 | 80 | <!--/Toolbar --> |
81 | | - |
82 | 81 | <!-- Search --> |
83 | 82 | @if (!string.IsNullOrEmpty(searchTerm)) |
84 | 83 | { |
85 | | - <div class="bf-post-search"> |
86 | | - <a href="~/@returnUrl"><i class="fa fa-chevron-left"></i><span>Search Result: @searchTerm</span></a> |
87 | | - </div> |
| 84 | + <div class="bf-post-search"> |
| 85 | + <a href="~/@returnUrl"><i class="fa fa-chevron-left"></i><span>Search Result: @searchTerm</span></a> |
| 86 | + </div> |
88 | 87 | } |
89 | 88 | <!--/Search --> |
90 | | - |
91 | 89 | <!-- List --> |
92 | 90 | <ul class="bf-list bf-posts-list @listStyle" aria-label="posts"> |
93 | 91 | @foreach (var item in Model.BlogPosts) |
|
100 | 98 | <a class="bf-list-item-link" href="~/admin/posts/editor/@item.BlogPostId?user=@user">@item.Title</a> |
101 | 99 | <span class="bf-list-item-status bf-list-item-status-@postStatus ml-auto" data-tooltip title="@postStatus"><i class="fa fa-circle"></i></span> |
102 | 100 | <span class="bf-list-item-date ml-3 d-none d-lg-block">@publishedLbl</span> |
103 | | - @if (Model.Profile.IsAdmin) { |
104 | | - <button class="btn-unstyled bf-list-item-favorite ml-3" data-tooltip title="featured" onclick="postsController.featured('@item.BlogPostId', this)"> @if (item.IsFeatured) { <i class="fa fa-star"></i> } else { <i class="fa fa-star-o"></i> } </button> |
| 101 | + @if (Model.Profile.IsAdmin) |
| 102 | + { |
| 103 | + <button class="btn-unstyled bf-list-item-favorite ml-3" data-tooltip title="featured" onclick="postsController.featured('@item.BlogPostId', this)"> |
| 104 | + @if (item.IsFeatured) |
| 105 | + { <i class="fa fa-star"></i> } |
| 106 | + else |
| 107 | + { <i class="fa fa-star-o"></i> } |
| 108 | + </button> |
105 | 109 | } |
106 | 110 | <a class="bf-list-item-show ml-3" href="~/@ApplicationSettings.BlogRoute@item.Slug" target="_blank" data-tooltip title="View"><i class="fa fa-external-link-square"></i></a> |
107 | 111 | </li> |
108 | 112 | } |
109 | 113 | </ul> |
110 | 114 | <!--/List --> |
111 | | - |
112 | 115 | <!-- Grid --> |
113 | 116 | <div class="bf-posts-grid @gridStyle" aria-label="posts"> |
114 | | - @foreach (var item in Model.BlogPosts) |
115 | | - { |
116 | | - var publishedLbl = item.Published == DateTime.MinValue ? item.LastUpdated.ToString("MMM dd, yyyy") : item.Published.ToString("MMM dd, yyyy"); |
117 | | - var postStatus = item.Published == DateTime.MinValue ? "draft" : "published"; |
118 | | - if (curPost == 0) { curPost = item.BlogPostId; } |
119 | | - <div class="post-grid-col"> |
120 | | - <div class="post-grid-item"> |
121 | | - <a class="item-link" href="~/admin/posts/editor/@item.BlogPostId?user=@user" style="background-image:url(@item.Image);"><div class="item-title mt-auto">@item.Title</div></a> |
122 | | - <div class="item-info d-flex"> |
123 | | - <label class="item-select custom-control custom-checkbox mr-3 my-auto" data-tooltip title="Select"><input type="checkbox" id="@item.BlogPostId" class="item-checkbox custom-control-input"><span class="item-control custom-control-indicator"></span></label> |
124 | | - <span class="item-date my-auto">@publishedLbl</span> |
125 | | - <span class="item-status item-status-@postStatus my-auto ml-auto" data-tooltip title="@postStatus"><i class="fa fa-circle"></i></span> |
126 | | - @if (Model.Profile.IsAdmin) { |
127 | | - <button class="btn-unstyled item-favorite my-auto ml-3" data-tooltip title="featured" onclick="postsController.featured('@item.BlogPostId', this)"> @if (item.IsFeatured) { <i class="fa fa-star"></i> } else { <i class="fa fa-star-o"></i> } </button> |
128 | | - } |
129 | | - <a class="item-show my-auto ml-3" href="~/@ApplicationSettings.BlogRoute@item.Slug" target="_blank" data-tooltip title="View"><i class="fa fa-external-link-square"></i></a> |
| 117 | + @foreach (var item in Model.BlogPosts) |
| 118 | + { |
| 119 | + var publishedLbl = item.Published == DateTime.MinValue ? item.LastUpdated.ToString("MMM dd, yyyy") : item.Published.ToString("MMM dd, yyyy"); |
| 120 | + var postStatus = item.Published == DateTime.MinValue ? "draft" : "published"; |
| 121 | + if (curPost == 0) { curPost = item.BlogPostId; } |
| 122 | + <div class="post-grid-col"> |
| 123 | + <div class="post-grid-item"> |
| 124 | + <a class="item-link" href="~/admin/posts/editor/@item.BlogPostId?user=@user" style="background-image:url(@item.Image);"><div class="item-title mt-auto">@item.Title</div></a> |
| 125 | + <div class="item-info d-flex"> |
| 126 | + <label class="item-select custom-control custom-checkbox mr-3 my-auto" data-tooltip title="Select"><input type="checkbox" id="@item.BlogPostId" class="item-checkbox custom-control-input"><span class="item-control custom-control-indicator"></span></label> |
| 127 | + <span class="item-date my-auto">@publishedLbl</span> |
| 128 | + <span class="item-status item-status-@postStatus my-auto ml-auto" data-tooltip title="@postStatus"><i class="fa fa-circle"></i></span> |
| 129 | + @if (Model.Profile.IsAdmin) |
| 130 | + { |
| 131 | + <button class="btn-unstyled item-favorite my-auto ml-3" data-tooltip title="featured" onclick="postsController.featured('@item.BlogPostId', this)"> |
| 132 | + @if (item.IsFeatured) |
| 133 | + { <i class="fa fa-star"></i> } |
| 134 | + else |
| 135 | + { <i class="fa fa-star-o"></i> } |
| 136 | + </button> |
| 137 | + } |
| 138 | + <a class="item-show my-auto ml-3" href="~/@ApplicationSettings.BlogRoute@item.Slug" target="_blank" data-tooltip title="View"><i class="fa fa-external-link-square"></i></a> |
| 139 | + </div> |
| 140 | + </div> |
130 | 141 | </div> |
131 | | - </div> |
132 | | - </div> |
133 | | - } |
| 142 | + } |
134 | 143 | </div> |
135 | 144 | <!--/Grid --> |
136 | | - |
137 | 145 | <!-- Empty --> |
138 | 146 | @if (Model.BlogPosts.Count() == 0) |
139 | 147 | { |
|
142 | 150 | </div> |
143 | 151 | } |
144 | 152 | <!--/Empty --> |
145 | | - |
146 | 153 | <!-- Pagination --> |
147 | 154 | @if (pgr.ShowNewer || pgr.ShowOlder) |
148 | 155 | { |
|
162 | 169 |
|
163 | 170 | @Html.Partial($"~/{ApplicationSettings.BlogAdminFolder}/_Shared/_FileManager.cshtml") |
164 | 171 | @section Scripts{ |
165 | | - <script src="~/admin/js/app/postsController.js"></script> |
166 | | - <script> |
167 | | - var submitFilter = function () { |
168 | | - $('#frmPostFilter').submit(); |
169 | | - } |
170 | | - </script> |
| 172 | + <script src="~/admin/js/app/postsController.js"></script> |
| 173 | + <script> |
| 174 | + var submitFilter = function () { |
| 175 | + $('#frmPostFilter').submit(); |
| 176 | + } |
| 177 | + </script> |
171 | 178 | } |
0 commit comments