<aside class="sidebar">

  

  
  <object data="<?php echo e($video->link); ?>" width="320" height="215"></object>

  
  <div class="tabs mb-xlg">
    <ul class="nav nav-tabs">
      <li class="active"><a href="#latestPosts" data-toggle="tab" class="font12"><?php echo e(trans('resource.latestNews')); ?></a></li>
      <li><a href="#viewedPosts" data-toggle="tab" class="font12"><?php echo e(trans('resource.most_viewed')); ?></a></li>
      <li><a href="#commentPosts" data-toggle="tab" class="font12"><?php echo e(trans('resource.most_comment')); ?></a></li>
    </ul>
    <div class="tab-content">
      <div class="tab-pane active" id="latestPosts">
        <ul class="simple-post-list">
          <?php $__currentLoopData = $latest; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getFirstLoop(); ?>
            <li>
              <div class="post-image">
                <div class="img-thumbnail">
                  <a href="/post/<?php echo e($item->id); ?>">
                    <img src="<?php echo e($item->thumbnail); ?>" alt="" style="height: 50px; width: 50px;">
                  </a>
                </div>
              </div>
              <div class="post-info">
                <a href="/post/<?php echo e($item->id); ?>"><div style="overflow: hidden; height: 50px; font-size: 12px;line-height: 18px; color: #000;"><?php echo e($item->title); ?></div></a>
                <div class="post-meta">
                   <?php echo e($item->update_date); ?>

                </div>
              </div>
            </li>
          <?php endforeach; $__env->popLoop(); $loop = $__env->getFirstLoop(); ?>
        </ul>
      </div>
      <div class="tab-pane" id="viewedPosts">
        <ul class="simple-post-list">
          <?php $__currentLoopData = $viewed; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getFirstLoop(); ?>
            <li>
              <div class="post-image">
                <div class="img-thumbnail">
                  <a href="/post/<?php echo e($item->id); ?>">
                    <img src="<?php echo e($item->thumbnail); ?>" alt="" style="height: 50px; width: 50px;">
                  </a>
                </div>
              </div>
              <div class="post-info">
                <a href="/post/<?php echo e($item->id); ?>"><div style="overflow: hidden; height: 50px; font-size: 12px;line-height: 18px;"><?php echo e($item->title); ?></div></a>
                <div class="post-meta">
                   <?php echo e($item->update_date); ?>

                </div>
              </div>
            </li>
          <?php endforeach; $__env->popLoop(); $loop = $__env->getFirstLoop(); ?>
        </ul>
      </div>
      <div class="tab-pane" id="commentPosts">
        <ul class="simple-post-list">
          <?php $__currentLoopData = $comment; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getFirstLoop(); ?>
            <li>
              <div class="post-image">
                <div class="img-thumbnail">
                  <a href="/post/<?php echo e($item->id); ?>">
                    <img src="<?php echo e($item->thumbnail); ?>" alt="" style="height: 50px; width: 50px;">
                  </a>
                </div>
              </div>
              <div class="post-info">
                <a href="/post/<?php echo e($item->id); ?>"><div style="overflow: hidden; height: 50px; font-size: 12px;line-height: 18px;"><?php echo e($item->title); ?></div></a>
                <div class="post-meta">
                   <?php echo e($item->update_date); ?>

                </div>
              </div>
            </li>
          <?php endforeach; $__env->popLoop(); $loop = $__env->getFirstLoop(); ?>
        </ul>
      </div>
    </div>
  </div>

  

  <h4 class="heading-primary"><?php echo e(trans('resource.viewfile')); ?></h4>
  <blockquote class="with-borders">
    <ul style="list-style: none; padding-left: 0;">
    <?php $__currentLoopData = $filetypes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $filetype): $__env->incrementLoopIndices(); $loop = $__env->getFirstLoop(); ?>
      <li class="file-item">
        <a href="/file/<?php echo e($filetype->ft_id); ?>">
          <i class="fa fa-<?php echo e($filetype->icon); ?>" style="cursor: pointer;"></i>
          <label style="cursor: pointer;"><?php echo e($filetype->source); ?></label>
          <input type="hidden" value="<?php echo e($filetype->ft_id); ?>" name="type_id"/>
        </a>
      </li>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getFirstLoop(); ?>
    </ul>
  </blockquote>
  <iframe id="forecast_embed" type="text/html" frameborder="0" height="270" width="260" src="http://tsag-agaar.gov.mn/embed/?name=<?php echo e($weather[0]->link); ?>&color=ef6e25&color2=cc530e&color3=ffffff&color4=ffffff&type=vertical&tdegree=cwidth=270"> </iframe>
  <!-- POLL START -->
  <?php if(!empty($poll)): ?>
  <?php echo e(csrf_field()); ?>

  <blockquote class="blockquote-secondary">
    <h6 class="heading-primary"><?php echo e(trans('resource.polling')); ?></h6>
  </blockquote>
  <blockquote class="with-borders">
    <blockquote class="">
      <h6 class=""><strong><?php echo e($poll->source); ?></strong></h6>
    </blockquote>
    <div id="poll-list">
    <?php $__currentLoopData = $answers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $a): $__env->incrementLoopIndices(); $loop = $__env->getFirstLoop(); ?>
      <?php if(Session::get('poll')): ?>
        <div><label class="rd-label"><?php echo e($a->source); ?></label>&nbsp;-&nbsp;<label class="rd-label pull-right"><?php echo e($a->total); ?></label></div>
      <?php else: ?>
        <div class="radio"><label><input type="radio" name="answer" value="<?php echo e($a->id); ?>"> <?php echo e($a->source); ?></label></div>
      <?php endif; ?>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getFirstLoop(); ?>
    </div>
    <?php if(!Session::get('poll')): ?>
    <button class="btnPollSubmit btn btn-borders btn-default mr-xs mb-sm" type="button" onclick="submitpoll(<?php echo e($poll->id); ?>)"><?php echo e(trans('resource.poll.givepoll')); ?></button>
    <?php endif; ?>
  </blockquote>
  <?php endif; ?>
  <!-- POLL END -->
</aside>

<script>

$(document).ready(function(){
  $(".nano").nanoScroller();
});

function submitpoll(poll_id){
    if($("[name=answer]").val() != undefined && $("[name=answer]").val() != null){
        $.post("/submitpoll", {'answer_id': $("[name=answer]:checked").val(), 'poll_id' : poll_id, '_token' : $("[name='_token']").val()}, function(data){
            $obj = "";
            $.each(data, function(i, v){
                $obj += '<div><label class="rd-label">'+v.source+'</label>&nbsp;-&nbsp;<label class="rd-label pull-right" >'+v.total+'</label></div>';
            });
            $(".btnPollSubmit").remove();
            $("#poll-list").html($obj);
            refreshPollDashboard();
        });
    }
}
</script>
