HTMLify

search-result.html
Views: 125 | Author: abh
<!-- search-result.html -->
<!DOCTYPE html>
<html>
<head>
    <title>HTMLify Search - {{ q }}</title>
    {% include "stylesheet.html" %}
    <style>
    </style>
</head>
<body>
<h1>HTMLify</h1>
{% include "nav-bar.html" %}
{% include "search-bar.html" %}
    <form class="filter-form" action="" method="POST">
    <div class="filter-label">Filter Options:</div>
    <label class="filter-option">
    <input type="checkbox" name="file-modes" value="p" {% if 'p' in session["filter-file-modes"] %}checked{% endif %}> Parse
    </label>
    <label class="filter-option">
    <input type="checkbox" name="file-modes" value="s" {% if 's' in session["filter-file-modes"] %}checked{% endif %}> Show
    </label>
    <label class="filter-option">
    <input type="checkbox" name="file-modes" value="r" {% if 'r' in session["filter-file-modes"] %}checked{% endif %}> Raw
    </label>
    <button class="filter-button" type="submit">Filter</button>
    </form>

{% for result in results %}
    <div class="search-result">
        <span>{{ result["name"] }}</span> | <span>Owner: {{ result["owner"] }}</span> | Views: {{ result["views"] }} | Comments: {{ result["comments"] | string }} | <a href="{{ result["path"] }}">Open</a>/ <a href="/src/{{ result["path"] }}">Source</a>{% if session.get("user") and result["owner"] == session["user"]["username"] %}| <a href="/edit?filepath={{ result["path"][result.owner|length + 1:] }}">Edit</a>{% endif %}<br>
        <hr>
        <p>{{ result["snippet"] | safe }}</p>
    </div>
{% endfor %}
<!-- impliment pagination -->
</body>
</html>

Comments