<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
{% load bibmate_extras %}
{% load url from future %}
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title>List of publications</title>
        <script type="text/javascript">
            <!--
            function toggleVisibility(id, imgId) {
                var e = document.getElementById(id);
                var i = document.getElementById(imgId)
                if(e.style.display == 'block') {
                    e.style.display = 'none';
                    i.src = "{{ STATIC_URL }}img/closed.gif"
                }
                else {
                    e.style.display = 'block';
                    i.src = "{{ STATIC_URL }}img/open.gif"
                }
            }
            //-->
        </script>
        <link rel="stylesheet" href="{{ STATIC_URL }}css/publications.css"/>
    </head>
    <body>
        <div id="publicationsList">
            {% for year, pubs_list in pubs_by_year %}
            {% if not omitYears %}
            <h3>{{ year }}</h3>
            {% endif %}
            {% for pub in pubs_list %}
            <div class="publication" id="publication_{{ pub.id }}">
                <table>
                    <tr>
                        <td>
                            <div class="showMoreInfo">
                                <a
                                    href="javascript:toggleVisibility('moreInfo_{{ pub.id }}', 'toggleimg_{{ pub.id }}')"
                                    title="toggle more info"> 
                                    <img
                                        id="toggleimg_{{ pub.id }}"
                                        class="toggleimg"
                                        src="{{ STATIC_URL }}img/closed.gif"
                                        alt="toggle visibility" width="9" height="9" hspace="0" border="0"/> 
                                </a>
                            </div>
                        </td>
                        <td>
                            <div class="citationText">
                                {{ pub.get_html|safe }}
                            </div>
                        </td>
                        <td>
                        </td>
                    </tr>
                </table>
                <div class="moreInfo" id="moreInfo_{{ pub.id }}" style="display: none;">
                    {% if pub.keywords.all %}
                    <div class="keywords">
                        <strong>keywords:</strong>
                        {% for k in pub.keywords.all %}
                        	{{ k.name }}
                        	{% if not forloop.last %}, {% endif %}
                        {% endfor %}
                    </div>
                    {% endif %}
                    {% if pub.abstract %}
                    <div class="abstract">
                        <strong>abstract:</strong> {{ pub.abstract }}
                    </div>
                    {% endif %}
                    <div class="moreInfoLinks">
                        {% if user.is_authenticated %}
                        <span class="editLink">
                            &nbsp;|&nbsp;
                            <a href="{% url 'edit' pub.id %}">Edit</a>
                        </span>
                        {% endif %}
                        <span class="bibtexLink">
                            &nbsp;|&nbsp;
                            <a href="{% domain_url %}{% url 'bibtex' pub.id %}" target="_blank">Export as Bibtex</a>
                        </span>
                        &nbsp;|&nbsp;
                    </div>
                </div>
            </div>
            {% endfor %}
            {% endfor %}
        </div>
    </body>
</html>
