<{includeq file="db:tad_web_header.html"}>

<{if $op=="tad_web_discuss_form"}>
  <{if $LoginMemID=="" and !$isWebOwner}>
    <{includeq file="db:tad_web_discuss_login_tpl.html"}>
  <{else}>

    <{$formValidator_code}>
    <div class="row-fluid">
    <form action="discuss.php" method="post" id="myForm" enctype="multipart/form-data">
      <!--標題-->
      <div class="controls controls-row">
        <div class="span2"><{$smarty.const._MD_TCW_DISCUSSTITLE}></div>
        <input type="text" name="DiscussTitle" value="<{$DiscussTitle}>" id="DiscussTitle" class="span10 validate[required]" placeholder="<{$smarty.const._MD_TCW_DISCUSSTITLE}>">
      </div>
      
      <!--內容-->
      <div class="controls controls-row">
        <div class="span2"><{$smarty.const._MD_TCW_DISCUSSCONTENT}></div>
        <textarea name="DiscussContent" class="span10" rows=15 id="DiscussContent" placehold="<{$smarty.const._MD_TCW_DISCUSSCONTENT}>"><{$DiscussContent}></textarea>
      </div>
      
      <div class="controls controls-row" style="text-align:right;">

        <input type="hidden" name="WebID" value="<{$WebID}>">
        <input type="hidden" name="DiscussID" value="<{$DiscussID}>">
        <input type="hidden" name="ReDiscussID" value="<{$ReDiscussID}>">
        <input type="hidden" name="WebID" value="<{$LoginWebID}>">

        <input type="hidden" name="op" value="<{$next_op}>">
        <button type="submit" class="btn btn-primary"><{$smarty.const._MD_TCW_DISCUSS_SUBMIT}></button>
      </div>
      
    </form>
    </div>
  <{/if}>  
  
<{elseif $op=="show_one_tad_web_discuss"}>

  <link href="bubble.css" rel="stylesheet" type="text/css">
  <script>
  	function delete_tad_web_discuss_func(DiscussID){
  		var sure = window.confirm("<{$smarty.const._TAD_DEL_CONFIRM}>");
  		if (!sure)	return;
  		location.href="discuss.php?op=delete_tad_web_discuss&DiscussID=" + DiscussID;
  	}
  </script>
  
  <h1><{$DiscussTitle}></h1>
  <div style="text-align:right;font-size:12px;">
    <{$DiscussInfo}>
    <{if $isMineDiscuss}>
      <a href="javascript:delete_tad_web_discuss_func(<{$DiscussID}>);" class="btn btn-mini btn-danger"><{$smarty.const._TAD_DEL}></a>
      <a href="discuss.php?op=tad_web_discuss_form&DiscussID=<{$DiscussID}>" class="btn btn-mini btn-warning"><{$smarty.const._TAD_EDIT}></a>
    <{/if}>
  </div>
  <div class="well" style="line-height:180%;">
    <{$DiscussContent}>
  </div>
  
  <{$re}>
  
  <{if $LoginMemID or $isWebOwner}>
    <form action="discuss.php" method="post" id="myForm" enctype="multipart/form-data">
    <div class="controls controls-row">
    <textarea name="DiscussContent" class="span12" rows=8 id="DiscussContent" class="validate[required , length[10,9999]]"></textarea>
    </div>
    
    	<!--領域-->
    	<input type="hidden" name="WebID" value="<{$WebID}>">

    	<!--回覆編號-->
    	<input type="hidden" name="ReDiscussID" value="<{$DiscussID}>">
    	<input type="hidden" name="DiscussTitle" value="Re:<{$DiscussTitle}>" id="DiscussTitle">
    	<input type="hidden" name="op" value="insert_tad_web_discuss">
      <button type="submit" class="btn btn-primary"><{$smarty.const._MD_TCW_DISCUSS_TO_REPLY}></button>


    </form>
  <{/if}>

<{else}>
  <{$FooTableJS}>
  <{includeq file="db:tad_web_discuss_login_tpl.html"}>
  <{includeq file="db:tad_web_common_discuss.html"}>
<{/if}>