{% extends "base_generic.html" %}
{% load static %}
{% block title %}
<title>愛爾蘭語—華語線上辭典 - 首頁</title>{% endblock %}
{% block content %}
<link rel="stylesheet" href="{% static 'ga_search.css' %}">
<div id="search-bar">
<form method="POST">
    {% csrf_token %}
    <div id="search-content">
	<h1 id="search-content-head">搜尋內容</h1>
    <label for="{{form.search_content.id_for_label}}">搜尋內容：</label>{{form.search_content}}
    </div>
    <div id="options">
    {% for option in form.choice_field %}
    <span id="{{option.id_for_label}}">{{option.label_tag}} {{option}}</span>
    {% endfor %}
    </div>
    <input type="submit" value="搜尋">
</form>
</div>
<div id="search-result">
		{% if entry == "" %}
		<!-- Let it blank -->
		{% elif entry_len == 0 %}
		對不起，找不到條目，請試著檢查有無錯字（或是有沒有輸入）錯字，或是調整語法變化，也有可能您輸入的是用詞變體。<br/>
		{% else %}
		您要找的搜尋結果如下，共 {{entry_len}} 筆：
        {% for e in entry_list %}
		<div class="entry">
        <span class="gaeilge">{{e.Gaeilge}}</span>
		<span class="pos">{{e.PoS}}</span>
		<!-- Pronounciation-->
		{%if e.Pronoun != None %}
		<span class="pronoun">[{{e.Pronoun}}]</span>
		{% endif %}
		{%if e.PreScript != None %}
		<span class="prescript">（{{e.PreScript}}）</span>
		{% endif %}
		<ol>
		{%for exp in e.Explanation %}
		<li class="prescript">{{exp}}</li>
		{% endfor %}
		</ol>
		{%if e.PostScript != None %}
		<span class="postscript">註：{{e.PostScript}}</span>
		{% endif %}
		</div>
		{% endfor %}
		{% endif %}

{% endblock %}
