PageRenderTime 169ms CodeModel.GetById 165ms app.highlight 2ms RepoModel.GetById 0ms app.codeStats 1ms

/source/app/NOS.Wiki/Edit.aspx

http://github.com/agross/netopenspace
ASP.NET | 210 lines | 146 code | 23 blank | 41 comment | 6 complexity | 29867c8fb0ad6ba32586e30b0243e2e1 MD5 | raw file
  1<%@ Page Language="C#" MasterPageFile="~/MasterPageSA.master" AutoEventWireup="true" CodeBehind="Edit.aspx.cs" Inherits="ScrewTurn.Wiki.Edit" ValidateRequest="false" culture="auto" meta:resourcekey="PageResource2" uiculture="auto" %>
  2
  3<%@ Register TagPrefix="st" TagName="Editor" Src="~/Editor.ascx" %>
  4<%@ Register TagPrefix="st" TagName="Captcha" Src="~/Captcha.ascx" %>
  5<%@ Register TagPrefix="st" TagName="AttachmentManager" Src="~/AttachmentManager.ascx" %>
  6
  7<asp:Content ID="CtnEdit" ContentPlaceHolderID="CphMasterSA" runat="server">
  8
  9	<script type="text/javascript">
 10	<!--
 11	
 12		var submitted = false;
 13		function __UnloadPage(e) {
 14		    if (!submitted) {
 15		        if (document.getElementById('EditorDiv').getElementsByTagName('textarea')[0].value.length != 0) {
 16				    e.returnValue = " ";
 17				}
 18			}
 19		}
 20
 21		function __SetSubmitted() {
 22			submitted = true;
 23        }
 24		
 25		function __RequestConfirmIfNotEmpty() {
 26		    if (document.getElementById('EditorDiv').getElementsByTagName('textarea')[0].value.length != 0) {
 27		      return(__RequestConfirm());
 28		    }
 29		}
 30		
 31	// -->
 32	</script>
 33
 34	<asp:Panel ID="pnlCollisions" runat="server" Visible="False" 
 35		CssClass="collisionsmanagement" meta:resourcekey="pnlCollisionsResource1">
 36        <asp:Literal ID="lblConcurrentEditing" runat="server" Text="&lt;b&gt;Warning&lt;/b&gt;: this Page is being edited by another user" meta:resourcekey="lblConcurrentEditingResource1" />
 37        <asp:Literal ID="lblConcurrentEditingUsername" runat="server" meta:resourcekey="lblConcurrentEditingUsernameResource1" />.
 38        <asp:Literal ID="lblSaveDangerous" runat="server" Visible="False" Text="Saving this Page might result in a &lt;b&gt;data-loss&lt;/b&gt;." meta:resourcekey="lblSaveDangerousResource1" />
 39        <asp:Literal ID="lblSaveDisabled" runat="server" Visible="False" Text="The Administrators don't allow to save this Page." meta:resourcekey="lblSaveDisabledResource1" />
 40        <asp:Literal ID="lblRefreshLink" runat="server" meta:resourcekey="lblRefreshLinkResource1" />
 41	</asp:Panel>
 42	
 43	<asp:Panel ID="pnlAnonymous" runat="server" Visible="False" CssClass="anonymous" meta:resourcekey="pnlAnonymousResource1">
 44		<asp:Literal ID="lblIpLogged" runat="server" Text="Since you are not logged in, your IP Address will be used as Username." meta:resourcekey="lblIpLoggedResource1" />
 45	</asp:Panel>
 46	
 47	<asp:Panel ID="pnlDraft" runat="server" Visible="False" CssClass="draftmanagement" meta:resourcekey="pnlDraftResource1">
 48		<asp:Literal ID="lblDraftInfo" runat="server" Text="You are currently editing a previously saved <b>draft</b> of this page, edited by <b>##USER##</b> on <b>##DATETIME##</b> (##VIEWCHANGES##)." 
 49			meta:resourcekey="lblDraftInfoResource1" />
 50		<asp:Literal ID="lblDraftInfo2" runat="server" Text="If you think this content is ready for display, simply unckeck the 'Save as Draft' checkbox near the 'Save' button. Note: drafts are not versioned." 
 51			meta:resourcekey="lblDraftInfo2Resource1" /><br />
 52	</asp:Panel>
 53	
 54	<asp:Panel ID="pnlApprovalRequired" runat="server" Visible="False" CssClass="draftmanagement" meta:resourcekey="pnlApprovalRequiredResource1">
 55		<asp:Literal ID="lblApprovalRequiredInfo" runat="server" Text="Your changes to this page will be saved in a draft and they will not be published until an editor or administrator approves them." 
 56			EnableViewState="False" meta:resourcekey="lblApprovalRequiredInfoResource1" />
 57	</asp:Panel>
 58	
 59	<div id="EditNoticeDiv">
 60		<asp:Literal ID="lblEditNotice" runat="server" EnableViewState="False" meta:resourcekey="lblEditNoticeResource1" />
 61	</div>
 62	
 63	<div id="ButtonsDiv">
 64		<asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" ValidationGroup="nametitle" meta:resourcekey="btnSaveResource1" />
 65		<asp:Button ID="btnSaveAndContinue" runat="server" Text="Save &amp; Continue" OnClick="btnSave_Click" ValidationGroup="nametitle" meta:resourcekey="btnSaveAndContinueResource1" />
 66		<asp:Button ID="btnCancel" runat="server" Text="Cancel" CausesValidation="False" OnClick="btnCancel_Click" meta:resourcekey="btnCancelResource1" />
 67		<div id="SaveOptionsDiv">
 68			<anthem:CheckBox ID="chkMinorChange" runat="server" Text="Minor Change (no backup)" OnCheckedChanged="chkMinorChange_CheckedChanged"
 69				AutoCallBack="True" AutoUpdateAfterCallBack="True" meta:resourcekey="chkMinorChangeResource1" UpdateAfterCallBack="True" /><br />
 70			<anthem:CheckBox ID="chkSaveAsDraft" runat="server" Text="Save as Draft" OnCheckedChanged="chkSaveAsDraft_CheckedChanged"
 71				AutoCallBack="True" AutoUpdateAfterCallBack="True" meta:resourcekey="chkSaveAsDraftResource1" UpdateAfterCallBack="True" />
 72		</div>
 73		<div id="ResultDiv">
 74			<asp:Label ID="lblResult" runat="server" EnableViewState="False" meta:resourcekey="lblResultResource1" />
 75		</div>
 76	</div>
 77
 78	<div id="PageNameAndTitleDiv">
 79		<anthem:Panel ID="pnlPageName" runat="server">
 80			<asp:Literal ID="lblName" runat="server" Text="Page Name (used for linking pages)" meta:resourcekey="lblNameResource1" /><br />
 81			<asp:TextBox ID="txtName" runat="server" CssClass="bigtextbox large" ToolTip="Type the name of the page here" meta:resourcekey="txtNameResource2" />
 82			<asp:RequiredFieldValidator ID="rfvName" runat="server" CssClass="resulterror" ErrorMessage="Name is required"
 83				Display="Dynamic" ControlToValidate="txtName" ValidationGroup="nametitle" meta:resourcekey="rfvNameResource1" />
 84			<asp:CustomValidator ID="cvName1" runat="server" CssClass="resulterror" ErrorMessage="Invalid Page Name"
 85				Display="Dynamic" ControlToValidate="txtName" OnServerValidate="cvName1_ServerValidate" ValidationGroup="nametitle" meta:resourcekey="cvName1Resource1" />
 86			<asp:CustomValidator ID="cvName2" runat="server" CssClass="resulterror" ErrorMessage="Page already exists"
 87				Display="Dynamic" ControlToValidate="txtName" OnServerValidate="cvName2_ServerValidate" ValidationGroup="nametitle" meta:resourcekey="cvName2Resource1" />
 88			<br />
 89		</anthem:Panel>
 90		<anthem:Panel ID="pnlManualName" runat="server" Visible="false">
 91			<anthem:LinkButton ID="btnManualName" runat="server" Text="Specify page name manually..."
 92				OnClick="btnManualName_Click" CssClass="small" meta:resourcekey="btnManualNameResource1" />
 93			<br />
 94		</anthem:Panel>
 95		<asp:Literal ID="lblTitle" runat="server" Text="Page Title" meta:resourcekey="lblTitleResource1" /><br />
 96		<asp:TextBox ID="txtTitle" runat="server" CssClass="bigtextbox large" ToolTip="Type the title of the page here" ValidationGroup="nametitle" 
 97			meta:resourcekey="txtTitleResource2" />
 98		<asp:RequiredFieldValidator ID="rfvTitle" runat="server" CssClass="resulterror" ErrorMessage="Title is required"
 99			Display="Dynamic" ControlToValidate="txtTitle" ValidationGroup="nametitle" meta:resourcekey="rfvTitleResource1" />
100	</div>
101	
102	<div id="TemplatesDiv">
103		<anthem:LinkButton ID="btnTemplates" runat="server" Text="Content Templates..." OnClick="btnTemplates_Click" 
104			AutoUpdateAfterCallBack="True" meta:resourcekey="btnTemplatesResource1" CssClass="small" />
105		
106		<anthem:Panel ID="pnlTemplates" runat="server" Visible="False" AutoUpdateAfterCallBack="True" meta:resourcekey="pnlTemplatesResource1">
107			<div id="TemplatesInternalDiv">
108				<anthem:DropDownList ID="lstTemplates" runat="server" AutoCallBack="True" OnSelectedIndexChanged="lstTemplates_SelectedIndexChanged" 
109					meta:resourcekey="lstTemplatesResource1" />
110				<div id="TemplatePreviewDiv">
111					<anthem:Label ID="lblTemplatePreview" runat="server" AutoUpdateAfterCallBack="True" meta:resourcekey="lblTemplatePreviewResource1" 
112						UpdateAfterCallBack="True" />
113				</div>
114				<small>
115					<anthem:LinkButton ID="btnUseTemplate" runat="server" Text="Use Template" ToolTip="Use this Template (replace current content)"
116						CausesValidation="False" AutoUpdateAfterCallBack="True" Visible="False" PreCallBackFunction="__RequestConfirmIfNotEmpty" OnClick="btnUseTemplate_Click" 
117						meta:resourcekey="btnUseTemplateResource1" UpdateAfterCallBack="True" />
118					&bull;
119					<anthem:LinkButton ID="btnCancelTemplate" runat="server" Text="Cancel" ToolTip="Close the Templates toolbar"
120						CausesValidation="False" OnClick="btnCancelTemplate_Click" meta:resourcekey="btnCancelTemplateResource1" />
121				</small>
122			</div>
123		</anthem:Panel>
124	</div>
125	
126	<anthem:Panel ID="pnlAutoTemplate" runat="server" Visible="False" CssClass="autotemplate" AutoUpdateAfterCallBack="True" 
127		meta:resourcekey="pnlAutoTemplateResource1" UpdateAfterCallBack="True">
128		<asp:Literal ID="lblAutoTemplate" runat="server" Text="The Content Template &quot;##TEMPLATE##&quot; was selected automatically. You can discard the content as well as select another Template using the link above." 
129			meta:resourcekey="lblAutoTemplateResource1" />
130		<anthem:LinkButton ID="btnAutoTemplateOK" runat="server" Text="Close" ToolTip="Close this message" OnClick="btnAutoTemplateOK_Click" 
131			meta:resourcekey="btnAutoTemplateOKResource1" />
132	</anthem:Panel>
133	
134	<div id="EditorDiv">
135		<st:Editor ID="editor" runat="server" OnSelectedTabChanged="editor_SelectedTabChanged" />
136	</div>
137	
138	<asp:Panel ID="pnlCaptcha" runat="server" CssClass="captcha" meta:resourcekey="pnlCaptchaResource1">
139		<st:Captcha ID="captcha" runat="server" />
140	</asp:Panel>
141	
142	<div id="CategoriesDiv">
143		<div>
144			<h3 class="separator"><asp:Literal ID="lblCategories" runat="server" Text="Page Categories" EnableViewState="False" meta:resourcekey="lblCategoriesResource1" /></h3>
145			<div id="CategoriesListDiv">
146				<anthem:CheckBoxList ID="lstCategories" runat="server" CssClass="medium h_short" RepeatLayout="Flow" AutoUpdateAfterCallBack="True" 
147					meta:resourcekey="lstCategoriesResource1" UpdateAfterCallBack="True" />
148			</div>
149			<anthem:Panel ID="pnlCategoryCreation" runat="server" CssClass="categorycreation" AutoUpdateAfterCallBack="True" 
150				meta:resourcekey="pnlCategoryCreationResource1" UpdateAfterCallBack="True">
151				<asp:Literal ID="lblNewCategory" runat="server" Text="New Category" EnableViewState="False" meta:resourcekey="lblNewCategoryResource1" /><br />
152				<anthem:TextBox ID="txtCategory" runat="server" CssClass="short" ToolTip="Type the name of the category here" ValidationGroup="category" 
153					meta:resourcekey="txtCategoryResource2" />
154				<anthem:Button ID="btnCreateCategory" runat="server" Text="Create" ValidationGroup="category" OnClick="btnCreateCategory_Click" 
155					meta:resourcekey="btnCreateCategoryResource1" /><br />
156				<asp:RequiredFieldValidator ID="rfvCategory" runat="server" ValidationGroup="category" ControlToValidate="txtCategory" Display="Dynamic"
157					ErrorMessage="Name is required" meta:resourcekey="rfvCategoryResource1" />
158				<asp:CustomValidator ID="cvCategory1" runat="server" ValidationGroup="category" ControlToValidate="txtCategory" Display="Dynamic"
159					ErrorMessage="Invalid Name" OnServerValidate="cvCategory1_ServerValidate" meta:resourcekey="cvCategory1Resource1" />
160				<asp:CustomValidator ID="cvCategory2" runat="server" ValidationGroup="category" ControlToValidate="txtCategory" Display="Dynamic"
161					ErrorMessage="Category already exists" OnServerValidate="cvCategory2_ServerValidate" meta:resourcekey="cvCategory2Resource1" />
162				<anthem:Label ID="lblCategoryResult" runat="server" meta:resourcekey="lblCategoryResultResource1" />
163			</anthem:Panel>
164		</div>
165	</div>
166	
167	<div id="EditCommentDiv">
168		<h3 class="separator"><asp:Literal ID="lblMeta" runat="server" Text="Meta Information" EnableViewState="False" meta:resourcekey="lblMetaResource1" /></h3>
169		<asp:Literal ID="lblKeywords" runat="server" Text="Meta Keywords (separate with commas)" EnableViewState="False" meta:resourcekey="lblKeywordsResource1" /><br />
170		<asp:TextBox ID="txtKeywords" runat="server" ToolTip="Type the keywords for this page here, separated with commas (optional)" meta:resourcekey="txtKeywordsResource2" /><br />
171		<asp:Literal ID="lblDescription" runat="server" Text="Meta Description" EnableViewState="False" meta:resourcekey="lblDescriptionResource1" /><br />
172		<asp:TextBox ID="txtDescription" runat="server" ToolTip="Type the description for this page here (optional)" meta:resourcekey="txtDescriptionResource2" />
173		<asp:Literal ID="lblComment" runat="server" Text="Comment for this change" EnableViewState="False" meta:resourcekey="lblCommentResource1" /><br />
174		<asp:TextBox ID="txtComment" runat="server" ToolTip="Type a comment for this change here (optional)" meta:resourcekey="txtCommentResource2" />
175	</div>
176	
177	<div id="AttachmentsDiv">
178		<h3 class="separator"><asp:Literal ID="lblAttachmentManager" runat="server" Text="Page Attachments Management" meta:resourcekey="lblAttachmentManagerResource1" /></h3>
179		<st:AttachmentManager ID="attachmentManager" runat="server" />
180	</div>
181	
182	<asp:Literal ID="lblSessionRefresh" runat="server" EnableViewState="False" meta:resourcekey="lblSessionRefreshResource1" />
183	
184	<script type="text/javascript">
185	<!--		
186		__GetServerElementById("btnSave").onclick = __SetSubmitted;
187		if(__GetServerElementById("btnSaveAndContinue")) {
188			__GetServerElementById("btnSaveAndContinue").onclick = __SetSubmitted;
189		}
190		__GetServerElementById("btnCancel").onclick = __SetSubmitted;
191		if(__GetServerElementById("btnNewCategory")) {
192		    __GetServerElementById("btnNewCategory").onclick = __SetSubmitted;
193		}
194
195		$(function() {
196			$("#<%= txtTitle.ClientID %>").focus().keydown(function(event) {
197				if(event.keyCode == 9 /* TAB */) {
198					event.preventDefault();
199					__FocusEditorWindow();
200				}
201			});
202		});
203	// -->
204    </script>
205	
206	<asp:Literal ID="lblUnloadPage" runat="server" meta:resourcekey="lblUnloadPageResource1" />
207	
208	<div class="cleanup"></div>
209
210</asp:Content>