<{if $isMineHomework}>
  <script>
    function delete_tad_web_news_func(NewsID){
      var sure = window.confirm("<{$smarty.const._TAD_DEL_CONFIRM}>");
      if (!sure)  return;
      location.href="homework.php?op=delete_tad_web_news&NewsID=" + NewsID;
    }
    </script>
<{/if}>

<{if $WebID}>
  <{if $homework_data}>
    <div class="row-fluid">
      <div class="span12">
        <h3>
          <a href="homework.php?WebID=<{$WebID}>&NewsID=<{$homework_data.0.NewsID}>"><{$homework_data.0.NewsTitle}></a>

          <{if !$showWebTitleNews && $isMineNews}>
            <a href="javascript:delete_tad_web_news_func(<{$homework_data.0.NewsID}>);" class="text-danger"><i class="fa fa-trash-o"></i></a>

            <a href="homework.php?op=tad_web_news_form&NewsID=<{$homework_data.0.NewsID}>" class="text-warning"><i class="fa fa-pencil"></i></a>
          <{/if}>
        </h3>
        <div style="mini-height: 100px; overflow: auto; line-height: 1.8; background-color: #FFFFFF; border: 2px solid #99C454; border-radius: 5px; margin:10px auto;">
          <{$homework_data.0.NewsContent}>
        </div>
      </div>
    </div>

    <div class="row-fluid">
      <div class="span12">
        <ul>
          <{foreach from=$homework_data key=i item=news}>
            <{if $i > 0}>
              <li>
              <{$news.Date}>
              <a href="<{$news.NewsKind}>.php?WebID=<{$news.WebID}>&NewsID=<{$news.NewsID}>"><{$news.NewsTitle}></a> (<{$news.NewsCounter}>)

                <{if !$showWebTitleNews && $isMineNews}>
                  <a href="javascript:delete_tad_web_news_func(<{$news.NewsID}>);" class="text-danger"><i class="fa fa-trash-o"></i></a>
                  <a href="homework.php?op=tad_web_news_form&NewsID=<{$news.NewsID}>" class="text-warning"><i class="fa fa-pencil"></i></a>
                <{/if}>
              </li>
            <{/if}>
          <{/foreach}>
        </ul>
      </div>
    </div>
  <{/if}>
<{else}>

  <h1><{$smarty.const._MD_TCW_HOMEWORK}></h1>
  <table class="footable table common_table">
    <thead>
      <tr>
        <th data-hide="phone" style="width:100px;text-align:center;">
          <{$smarty.const._MD_TCW_NEWSDATE}>
        </th>
        <th data-class="expand">
          <{$smarty.const._MD_TCW_HOMEWORK}>
        </th>
        <th data-hide="phone" style="width:50px;text-align:center;">
          <{$smarty.const._MD_TCW_NEWSCOUNTER}>
        </th>
        <{if $showWebTitleHomework}>
          <th data-hide="phone" style="width:100px;text-align:center;">
            <{$smarty.const._MD_TCW_TEAMID}>
          </th>
        <{/if}>
        <{if !$showWebTitleHomework && $isMineHomework}>
          <th data-hide="phone" style="width:100px;text-align:center;">
            <{$smarty.const._TAD_FUNCTION}>
          </th>
        <{/if}>
      </tr>
    </thead>
    <{if $homework_data}>
      <{foreach item=homework from=$homework_data}>
        <tr>
          <td class="text-center">
            <{$homework.Date}>
          </td>
          <td>
            <a href="<{$homework.NewsKind}>.php?WebID=<{$homework.WebID}>&NewsID=<{$homework.NewsID}>"><{$homework.NewsTitle}></a>
          </td>
          <td class="text-center">
            <{$homework.NewsCounter}>
          </td>
          <{if $showWebTitleHomework}>
            <td class="text-center">
              <{$homework.WebTitle}>
            </td>
          <{/if}>
          <{if !$showWebTitleHomework && $isMineHomework}>
            <td class="text-center">
              <a href="javascript:delete_tad_web_news_func(<{$news.NewsID}>);" class="btn btn-mini btn-danger"><i class="fa fa-trash-o"></i> <{$smarty.const._TAD_DEL}></a>
              <a href="homework.php?WebID=<{$news.WebID}>&op=tad_web_news_form&NewsID=<{$news.NewsID}>" class="btn btn-mini btn-warning"><i class="fa fa-pencil"></i> <{$smarty.const._TAD_EDIT}></a>
            </td>
        <{/if}>
      </tr>
      <{/foreach}>
    <{else}>
      <tr>
        <td colspan=4 class="text-center">
          <{$smarty.const._MD_TCW_EMPTY}>
        </td>
      </tr>
    <{/if}>
  </table>

  <{if $homework_data}>
    <{$bar}>
  <{/if}>

<{/if}>

<{if $homework_data}>
  <div style="text-align:right">
    <{if $bar==""}>
      <{if $WebID==""}>
        <a href="index.php?op=list_tad_web_homework" class="btn btn-mini btn-primary"><{$smarty.const._MD_TCW_MORE}><{$smarty.const._MD_TCW_HOMEWORK_SHORT}></a>
      <{else}>
        <a href="homework.php?WebID=<{$WebID}>" class="btn btn-mini btn-primary"><{$smarty.const._MD_TCW_MORE}><{$smarty.const._MD_TCW_HOMEWORK_SHORT}></a>
      <{/if}>
    <{/if}>
    <{if $isMineHomework and $WebID}>
      <a href="homework.php?WebID=<{$WebID}>&op=tad_web_news_form" class="btn btn-mini btn-info"><i class="fa fa-pencil"></i> <{$smarty.const._TAD_ADD}></a>
    <{/if}>
  </div>
<{/if}>