{% extends "base.html" %}
{% load staticfiles %}

{%block YACMS_HEAD %}

<link href="{%static "yacms/css/pageadmin.css" %}" rel="stylesheet">

<script>

var view_json = {{view_object.json_data | safe}}
</script>

<link rel="stylesheet" href="/static/yacms/mediauploader/css/jquery.fileupload.css">
<link rel="stylesheet" href="/static/yacms/mediauploader/css/jquery.fileupload-ui.css">

 <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link href="/static/assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">


{%endblock YACMS_HEAD %}


{%block DESCRIPTION %}{{view_object.introduction}}{% endblock DESCRIPTION %}
{% block TITLE%} {{view_object.title}}{% endblock TITLE %}
{% block BODY_TITLE%} Search Results {% endblock BODY_TITLE %}
{% block BREADCRUMBS_LIST_ENTRIES %}


<div id="search-form">
   
</div>

{% endblock BREADCRUMBS_LIST_ENTRIES %}

{%block PAGE-HEADER %}
<div class="container">
  <div class="row">
    <div class="col-md-6" ><h1>Search</h1></div>
    <div class="col-md-6"> 
    <span id="search-form"> 
    
      <form class="form-inline" role="form" method="get" action="/cms/search">
        <div class="input-group input-group-lg">
            <input type="search" name="q" id="id_q" class="form-control lg" placeholder="Search…">
              <span class="input-group-btn"><button type="submit" class="btn btn-sm">Submit</button></span>
        </div>
      </form>
    </span>
    <div>
  </div>
</div>
{%endblock PAGE-HEADER %}


{% block PAGE_CONTENT %}
<div class="container">
    <div class="row-fluid">
        <div class="col-md-12 page-content" id="page_content" >

    {% if query %}
    
    
    
      {% for result in page.object_list %}
        
        
      
        <div class="row">
        <section class="col-sm-11 col-xs-10 article-summary">
            <h2><a href={{result.object.get_absolute_url}}>{{result.object.title}}</a></h2>
                <p style="display: inline">{{result.object.view.introduction|safe|truncatewords_html:50 }}
                <a href="{{result.object.get_absolute_url}}" class="readMore">read more</a>
            </p>
            <ul class="entry-meta">
                <li class="entry-date"><a href="#"><i class="icon-pin"></i>&nbsp;{{result.object.view.created_timestamp_str}}</a></li>
                <li class="entry-category"><a href="result.object.get_absolute_url"><i class="icon-th-list"></i>&nbsp;{{result.object.parent.title}}</a></li>
                <li class="entry-author"><a href="#"><i class="icon-male"></i>&nbsp;Admin</a></li>
                <!-- li class="entry-comments"><a href="#"><i class="icon-comment-1"></i>&nbsp;12 comments</a></li -->
            </ul>
        </section>
    </div>
      
      
      
      
    {% empty %}
      <p>No results found.</p>
    {% endfor %}
    {% if page.has_previous or page.has_next %}
      <div>
        {% if page.has_previous %}
          <a href="?q={{ query }}&amp;page={{ page.previous_page_number }}">{% endif %}&laquo; Previous{% if page.has_previous %}</a>
        {% endif %}
        |
        {% if page.has_next %}
          <a href="?q={{ query }}&amp;page={{ page.next_page_number }}">{% endif %}Next &raquo;{% if page.has_next %}</a>
        {% endif %}
      </div>
    {% endif %}
    {% else %}
      {# Show some example queries to run, maybe query syntax, something else? #}
    {% endif %}
  </form>
 </div></div></div>
{% endblock PAGE_CONTENT %}
