<commit_before>{title url="tiki-blog_post.php?blogId=$blogId&amp;postId=$postId"}{if $postId gt 0}{tr}Edit Post{/tr}{else}{tr}New Post{/tr}{/if}{if !empty($blog_data.title)} - {$blog_data.title|escape}{/if}{/title}

<div class="navbar">
	{if $postId > 0}
		{button href=$postId|sefurl:blogpost _text="{tr}View post{/tr}"}
	{/if}

	{if $blogId gt 0 }
		{assign var=thisblog value=$blogId|sefurl:blog}
		{button href=$thisblog _text="{tr}View Blog{/tr}"}
	{/if}

	{if $blogs|@count gt 1 }
		{* No need for users to go to blog list if they are already looking at the only blog *}
		{button href="tiki-list_blogs.php" _text="{tr}List Blogs{/tr}"}
	{/if}
</div>

{if $contribution_needed eq 'y'}
	{remarksbox type='Warning' title="{tr}Warning{/tr}"}
		<div class="highlight"><em class='mandatory_note'>{tr}A contribution is mandatory{/tr}</em></div>
	{/remarksbox}
{/if}

{if $preview eq 'y'}
	<div align="center" class="attention" style="font-weight:bold">{tr}Note: Remember that this is only a preview, and has not yet been saved!{/tr}</div>
	<div class="blogpost post post_single">
		{include file='blog_wrapper.tpl' blog_post_context='preview'}
	</div>
{/if}

<form enctype="multipart/form-data" name='blogpost' method="post" action="tiki-blog_post.php" id ='editpageform'>
	<input type="hidden" name="wysiwyg" value="{$wysiwyg|escape}" />
	<input type="hidden" name="postId" value="{$postId|escape}" />

	<fieldset class="tabcontent">
		<table class="normal">
			{if $blogs|@count gt 1 and ( !isset($blogId) or $blogId eq 0 )}
				<tr>
					<td class="editblogform">{tr}Blog{/tr}</td>
					<td class="editblogform">
						<select name="blogId">
							{section name=ix loop=$blogs}
								<option value="{$blogs[ix].blogId|escape}" {if $blogs[ix].blogId eq $blogId}selected="selected"{/if}>{$blogs[ix].title|escape}</option>
							{/section}
						</select>
					</td>
				</tr>
			{else}
				<input type="hidden" name="blogId" value="{$blogId|escape}" />
			{/if}

			<tr>
				<td class="editblogform">{tr}Title:{/tr}</td><td class="editblogform">
					<input type="text" size="80" name="title" value="{$post_info.title|escape}" />
				</td>
			</tr>

			<tr>
				<td class="editblogform"><commit_msg>[FIX] keep url params when previewing a blog post<commit_after>{title url="tiki-blog_post.php?blogId=$blogId&amp;postId=$postId"}{if $postId gt 0}{tr}Edit Post{/tr}{else}{tr}New Post{/tr}{/if}{if !empty($blog_data.title)} - {$blog_data.title|escape}{/if}{/title}

<div class="navbar">
	{if $postId > 0}
		{button href=$postId|sefurl:blogpost _text="{tr}View post{/tr}"}
	{/if}

	{if $blogId gt 0 }
		{assign var=thisblog value=$blogId|sefurl:blog}
		{button href=$thisblog _text="{tr}View Blog{/tr}"}
	{/if}

	{if $blogs|@count gt 1 }
		{* No need for users to go to blog list if they are already looking at the only blog *}
		{button href="tiki-list_blogs.php" _text="{tr}List Blogs{/tr}"}
	{/if}
</div>

{if $contribution_needed eq 'y'}
	{remarksbox type='Warning' title="{tr}Warning{/tr}"}
		<div class="highlight"><em class='mandatory_note'>{tr}A contribution is mandatory{/tr}</em></div>
	{/remarksbox}
{/if}

{if $preview eq 'y'}
	<div align="center" class="attention" style="font-weight:bold">{tr}Note: Remember that this is only a preview, and has not yet been saved!{/tr}</div>
	<div class="blogpost post post_single">
		{include file='blog_wrapper.tpl' blog_post_context='preview'}
	</div>
{/if}

{capture name=actionUrlParam}{strip}
	{if $postId > 0 && $blogId > 0}
		?blogId={$blogId}&postId={$postId}
	{elseif $postId > 0}
		?postId={$postId}
	{elseif $blogId > 0}
		?blogId={$blogId}
	{/if}
{/strip}{/capture}

<form enctype="multipart/form-data" name='blogpost' method="post" action="tiki-blog_post.php{$smarty.capture.actionUrlParam}" id ='editpageform'>
	<input type="hidden" name="wysiwyg" value="{$wysiwyg|escape}" />
	<input type="hidden" name="postId" value="{$postId|escape}" />

	<fieldset class="tabcontent">
		<table class="normal">
			{if $blogs|@count gt 1 and ( !isset($blogId) or $blogId eq 0 )}
				<tr>
					<td class="editblogform">{tr}Blog{/tr}</td>
					<td class="editblogform">
						<select name="blogId">
							{section name=ix loop=$blogs}
								<option value="{$blogs[ix].blogId|escape}" {if $blogs[ix].blogId eq $blogId}selected="selected"{/if}>{$blogs[ix].title|escape}</option>
							{/section}
						</select>
					</td>
				</tr>
			{else}
				<input type="hidden" name="blogId" value="{$blogId|escape}" />
			{/if}

			<tr>
				<td class="editblogform">{tr}Title:{/tr}</td><td class="editblogform">
					<input type="text" size="80" name="title" value="{$post_info.title|escape}" />
				</td>
			</tr>

			<tr>
				<td class="editblogform">
{'fraction_non_alphanumeric': 0.20643374520664678, 'fraction_numerical': 0.004260758414997869, 'mean_word_length': 4.883458646616542, 'pattern_counts': {'":': 0, '<': 73, '<?xml version=': 0, '>': 79, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4413179', 'n_tokens_mistral': 2000, 'n_tokens_neox': 1773, 'n_words': 371}