{include file="$blogtemplate/header.template"}
{if $submissions->isEnabled()}
{if $submissions->isHtmlareaEnabled()}
  <script type="text/javascript" src="{$url->getBaseUrl()}/js/tinymce/tiny_mce_gzip.php"></script>
  <script type="text/javascript" src="{$url->getBaseUrl()}/plugins/submissions/js/tinymce-submissions.js"/></script>
{else}
  <link rel="stylesheet" href="{$url->getBaseUrl()}/js/editor/lifetypeeditor.css" type="text/css" />
  <script type="text/javascript" src="{$url->getBaseUrl()}/js/ui/core.js"></script>
  <script type="text/javascript" src="{$url->getBaseUrl()}/js/editor/lifetypeeditor.js"></script>
{/if}
{if $errors}
 <p style="color: red">
  {$errorMessage}
 </p>
{/if}
<form name="submission" method="post" action="{$url->getIndexUrl()}">
 <label for="userName" style="text-align:left">{$locale->tr("your_name")}</label>
 <input type="text" name="userName" value="{$userName}" style="width:100%" /><br/>
 
 <label for="userEmailAddress" style="text-align:left">{$locale->tr("your_email_address")}</label>
 <input type="text" name="userEmailAddress" value="{$userEmailAddress}" style="width:100%" /><br/>
 
 <label for="submissionTopic" style="text-align:left">{$locale->tr("story_topic")}</label>
 <input type="text" name="submissionTopic" value="{$submissionTopic}" style="width:100%" /><br/>
 {if $errors.submissionTopic}<span style="background:red;color:white;font-weight:bold">&nbsp;!&nbsp;</span>&nbsp;{$message.submissionTopic}</p>{/if}
 <br/>
 <br/>
  
 <div>
 <div style="width:68%;float:left;padding-right:2%">
  {$locale->tr("story_contents")}<br/>
  {if !$submissions->isHtmlareaEnabled()}<script type="text/javascript">var ed1 = new Lifetype.UI.Editor('submissionText','ed1');</script>{/if}
  <textarea rows="15" id="submissionText" name="submissionText" style="width:100%">{$submissionText}</textarea><br/>
  {if $errors.submissionText}<span style="background:red;color:white;font-weight:bold">&nbsp;!&nbsp;</span>&nbsp;{$message.submissionText}</p><br/>{/if}
  <br/>
 </div>
 
 <div style="width:29%;float:right;height:100%">
  {$locale->tr("categories")}<br/>
  <select name="submissionCategory[]" multiple="multiple" style="width:100%" size="15">
  {foreach from=$articlecategories item=category}
    <option value="{$category->getId()}">{$category->getName()}</option>
  {/foreach}
  </select>
  {if $errors.submissionCategory}<span style="background:red;color:white;font-weight:bold">&nbsp;!&nbsp;</span>&nbsp;{$message.submissionCategory}</p><br/>{/if}  
 </div> 
 </div>
 <div style="float:left;width:100%">
 <input type="hidden" name="op" value="submitStory" />
 <input type="hidden" name="blogId" value="{$blog->getId()}" />
 <input type="submit" name="{$locale->tr("submit_story")}" value="{$locale->tr("submit_story")}" />
 </div>
</form>
 {else}
  {$locale->tr("error_submissions_not_enabled")}
 {/if}
{include file="$blogtemplate/footer.template"}