<{if $op=="tad_web_discuss_form"}>
  <{if $LoginMemID=="" and $MyWebs==""}>
    <{includeq file="db:tad_web_discuss_login.html"}>
  <{else}>

    <{$formValidator_code}>
    <h1><{$smarty.const._MD_TCW_DISCUSS_ADD}></h1>
    <div class="well">
      <form action="discuss.php" method="post" id="myForm" enctype="multipart/form-data" class="form-horizontal" role="form">

        <!--分類-->
        <{$cate_menu}>

        <!--標題-->
        <div class="control-group">
          <div class="span12 controls">
            <input type="text" name="DiscussTitle" value="<{$DiscussTitle}>" id="DiscussTitle" class="span12 validate[required]" placeholder="<{$smarty.const._MD_TCW_DISCUSSTITLE}>">
          </div>
        </div>

        <!--內容-->
        <div class="control-group">
          <div class="span12 controls">
            <textarea name="DiscussContent" class="span12" rows=15 id="DiscussContent" placehold="<{$smarty.const._MD_TCW_DISCUSSCONTENT}>"><{$DiscussContent}></textarea>
          </div>
        </div>

        <div class="control-group">
          <div class="span12 controls text-center">
            <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="LoginWebID" 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>
        </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-xs btn-danger"><{$smarty.const._TAD_DEL}></a>
      <a href="discuss.php?WebID=<{$WebID}>&op=tad_web_discuss_form&DiscussID=<{$DiscussID}>" class="btn btn-xs btn-warning"><{$smarty.const._TAD_EDIT}></a>
    <{/if}>
  </div>

  <{if $DiscussContent}>
    <div class="well" style="line-height:180%;">
      <{$DiscussContent}>
    </div>
  <{/if}>

  <{$re}>

  <{if $LoginMemID or $MyWebs}>
    <form action="discuss.php" method="post" id="myForm" enctype="multipart/form-data" class="form-horizontal" role="form">
      <div class="control-group">
        <div class="span12 controls">
          <textarea name="DiscussContent" class="span12" rows=8 id="DiscussContent" class="validate[required , length[10,9999]]"></textarea>
        </div>
      </div>

      <div class="control-group">
        <div class="span12 controls">
          <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>
        </div>
      </div>
    </form>
  <{/if}>

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