forked from DNNCommunity/DNN.Blog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Manage.ascx
136 lines (134 loc) · 6.9 KB
/
Manage.ascx
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="Manage.ascx.vb" Inherits="DotNetNuke.Modules.Blog.Manage" %>
<%@ Import Namespace="DotNetNuke.Entities.Users" %>
<%@ Register TagPrefix="dnnweb" Assembly="DotNetNuke.Web.Deprecated" Namespace="DotNetNuke.Web.UI.WebControls" %>
<div class="dnnForm" id="tabs">
<ul class="dnnAdminTabNav">
<li id="blogsLink" runat="server"><a href="#<%= Blogs.ClientId %>"><%= LocalizeString("Blogs")%></a></li>
<li id="postsLink" runat="server"><a href="#<%= Posts.ClientId %>"><%= LocalizeString("Posts")%></a></li>
</ul>
<asp:Panel id="Blogs" runat="server" CssClass="dnnClear">
<asp:Repeater runat="server" ID="dlBlogs" >
<HeaderTemplate>
<table class="dnnGrid">
<tr class="dnnGridHeader">
<td></td>
<td></td>
<td></td>
<td><%= LocalizeString("Blog")%></td>
<td><%= LocalizeString("Owner")%></td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr class="dnnGridItem">
<td><a href="<%# EditUrl("Blog", Eval("BlogId"), "BlogEdit") %>" title="Edit"><i class="fa fa-pencil-square-o icon16"></i></a></td>
<td><a href="<%# EditUrl("Blog", Eval("BlogId"), "BlogImport") %>" title="Import"><i class="fa fa-download icon16"></i></a></td>
<td><a href="#" title="Export" data-blogid="<%# Eval("BlogId") %>"><i class="fa fa-upload icon16 exportlink"></i></a></td>
<td><%# Eval("Title") %></td>
<td><%# Eval("DisplayName") %></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
<p>
<asp:LinkButton runat="server" ID="cmdAdd" resourcekey="cmdAdd" CssClass="dnnSecondaryAction" />
</p>
</asp:Panel>
<asp:Panel id="Posts" runat="server" CssClass="dnnClear">
<div class="coreMessaging" id="blogPostsError"></div>
<dnnweb:DNNGrid id="grdPosts" autogeneratecolumns="false" cssclass="dnnGrid dnnSecurityRolesGrid"
runat="server" allowpaging="True" allowcustompaging="True" enableviewstate="True" AllowSorting="true"
onneeddatasource="GetPosts">
<MasterTableView>
<Columns>
<dnnweb:DnnGridTemplateColumn HeaderText="Actions">
<ItemStyle Width="90px"></ItemStyle>
<ItemTemplate>
<a href="<%# EditUrl("Post", Eval("ContentItemId"), "PostEdit") %>"
title="Edit"
style="display:<%# IIF(CType(Container.DataItem, DotNetNuke.Modules.Blog.Entities.Posts.PostInfo).Blog.CanEdit OR BlogContext.Security.CanEditThisPost(CType(Container.DataItem, DotNetNuke.Modules.Blog.Entities.Posts.PostInfo)), "inline", "none") %>"><i class="fa fa-pencil-square-o icon16"></i></a>
<a href="#"
onclick="if (confirm('<%= LocalizeJSString("DeletePost") %>')) {blogService.deletePost(<%# Eval("BlogID") %>, <%# Eval("ContentItemID") %>, function() {$('#cmdDeletePost<%# Eval("ContentItemID") %>').parent().parent().hide()})};return false;"
id="cmdDeletePost<%# Eval("ContentItemID") %>"
title="Delete"
style="display:<%# IIF(CType(Container.DataItem, DotNetNuke.Modules.Blog.Entities.Posts.PostInfo).Blog.CanEdit OR BlogContext.Security.CanEditThisPost(CType(Container.DataItem, DotNetNuke.Modules.Blog.Entities.Posts.PostInfo)), "inline", "none") %>"><i class="fa fa-times icon16"></i></a>
<a href="#"
onclick="if (confirm('<%= LocalizeJSString("ApprovePost") %>')) {blogService.approvePost(<%# Eval("BlogID") %>, <%# Eval("ContentItemID") %>, function() {$('#cmdApprovePost<%# Eval("ContentItemID") %>').hide();$('#approveTick<%# Eval("ContentItemID") %>').removeClass('fa fa-times icon16').addClass('fa fa-check icon16') })};return false;"
id="cmdApprovePost<%# Eval("ContentItemID") %>"
title="Approve"
style="display:<%# IIF(CType(Container.DataItem, DotNetNuke.Modules.Blog.Entities.Posts.PostInfo).Blog.CanApprove AND NOT CType(Container.DataItem, DotNetNuke.Modules.Blog.Entities.Posts.PostInfo).Published, "inline", "none") %>"><i class="fa fa-check icon16"></i></a>
</ItemTemplate>
</dnnweb:DnnGridTemplateColumn>
<dnnweb:DnnGridTemplateColumn headertext="Date">
<ItemTemplate>
<%# DotNetNuke.Modules.Blog.Common.Globals.UtcToLocalTime(Eval("PublishedOnDate"), UserController.GetCurrentUserInfo().Profile.PreferredTimeZone)%>
</ItemTemplate>
</dnnweb:DnnGridTemplateColumn>
<dnnweb:DnnGridBoundColumn datafield="Title" headertext="Title" AllowSorting="True" SortExpression="Title" />
<dnnweb:DnnGridTemplateColumn HeaderText="Published">
<ItemStyle Width="30px" HorizontalAlign="Center"></ItemStyle>
<ItemTemplate>
<i class="fa fa-<%# IIf(Eval("Published"), "check", "times")%> icon16" id="approveTick<%# Eval("ContentItemID") %>"></i>
</ItemTemplate>
</dnnweb:DnnGridTemplateColumn>
<dnnweb:DnnGridTemplateColumn HeaderText="Blog">
<ItemTemplate>
<asp:Label ID="Label1" Runat="server" Text='<%# CType(Container.DataItem, DotNetNuke.Modules.Blog.Entities.Posts.PostInfo).Blog.Title %>' />
</ItemTemplate>
</dnnweb:DnnGridTemplateColumn>
</Columns>
</MasterTableView>
</dnnweb:DNNGrid>
</asp:Panel>
</div>
<p class="updatecancelbar">
<asp:LinkButton runat="server" ID="cmdReturn" resourcekey="cmdReturn" CssClass="dnnPrimaryAction" />
</p>
<div id="blogServiceErrorBox">
</div>
<script type="text/javascript">
(function ($, Sys) {
$('#tabs').dnnTabs();
var selectedBlog;
var $dialogexport = $('<div class="dnnDialog"></div>')
.html('<p><%=LocalizeJSString("Export.Help") %></p><p><a id="blogMLDownloadLink" style=""><%=LocalizeJSString("Download") %></a></p>')
.dialog({
autoOpen: false,
resizable: false,
dialogClass: 'dnnFormPopup dnnClear',
title: '<%=LocalizeJSString("Export") %>',
height: 250,
width: 500,
open: function (e) {
$('#blogMLDownloadLink').hide();
$('.ui-dialog-buttonpane').find('button:contains("<%=LocalizeJSString("Export") %>")').addClass('dnnPrimaryAction');
$('.ui-dialog-buttonpane').find('button:contains("<%=LocalizeJSString("Cancel") %>")').addClass('dnnSecondaryAction');
},
buttons: [
{
text: '<%=LocalizeJSString("Cancel") %>',
click: function () {
$(this).dialog("close");
}
},
{
text: '<%=LocalizeJSString("Export") %>',
click: function () {
$('.ui-dialog-buttonpane').find('button:contains("<%=LocalizeJSString("Export") %>")').attr("disabled", "disabled");
blogService.exportBlog(selectedBlog, function (returnValue) {
$('.ui-dialog-buttonpane').find('button:contains("<%=LocalizeJSString("Export") %>")').removeAttr("disabled");
$('#blogMLDownloadLink').attr('href', returnValue.Result);
$('#blogMLDownloadLink').show();
});
}
}
]
});
$('.exportlink').click(function () {
selectedBlog = $(this).parent().attr('data-blogid');
$dialogexport.dialog('open');
return false;
});
} (jQuery, window.Sys));
</script>