thestudentlife/Manhattan-Project

View on GitHub
mainsite/templates/search/search.html

Summary

Maintainability
Test Coverage
{% extends 'base.html' %}
{% load static from staticfiles %}


{% block title_block %}
    <title>Search Results for {{ word }}</title>
{% endblock %}

{% block body_block %}
    <div class="tsl-container">
        <section id="article_ls" class="article-previews">
            <h2>Search Results for '{{ word }}'</h2>
            {% for result in qs %}
                {% include 'short_article_partial.html' with article=result.object %}
                {% empty %}
                <p>No results found.</p>
            {% endfor %}
        </section>
        {% include 'side_menu.html' %}
        {% include 'top_button_partial.html' %}
    </div>
{% endblock %}

{% block script_block %}
    <script src="{% static 'disqus.js' %}"></script>
    <script src="{% static 'search_scroll.js' %}"></script>
    <script type="text/javascript">
        function adjustLeftMargin() {
            var leftMargin = $('.article_info').offset().left;;
            $('.article_title').offset({left: leftMargin});
        }
        $(window).resize(function () {
            adjustLeftMargin();
        });
        adjustLeftMargin();
    </script>
{% endblock %}