{# ru-fu: copied from Furo, with modifications as stated below. Modifications are marked 'mod:'. #}

<div class="related-pages">
  {# mod: Per-page navigation #}
  {% if meta %}
    {% if 'sequential_nav' in meta %}
      {% set sequential_nav = meta.sequential_nav %}
    {% endif %}  
  {% endif %}
  {# mod: Conditional wrappers to control page navigation buttons #}
  {% if sequential_nav != "none" -%}
    {% if next and (sequential_nav == "next" or sequential_nav == "both") -%}
      <a class="next-page" href="{{ next.link }}">
        <div class="page-info">
          <div class="context">
            <span>{{ _("Next") }}</span>
          </div>
          <div class="title">{{ next.title }}</div>
        </div>
        <svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
      </a>
    {%- endif %}
    {% if prev and (sequential_nav == "prev" or sequential_nav == "both") -%}
      <a class="prev-page" href="{{ prev.link }}">
        <svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
        <div class="page-info">
          <div class="context">
            <span>{{ _("Previous") }}</span>
          </div>
          {% if prev.link == pathto(root_doc) %}
            <div class="title">{{ _("Home") }}</div>
          {% else %}
            <div class="title">{{ prev.title }}</div>
          {% endif %}
        </div>
      </a>
    {%- endif %}
  {%- endif %}
</div>
<div class="bottom-of-page">
  <div class="left-details">
    {%- if show_copyright %}
    <div class="copyright">
      {%- if hasdoc('copyright') %}
        {% trans path=pathto('copyright'), copyright=copyright|e -%}
          <a href="{{ path }}">Copyright</a> &#169; {{ copyright }}
        {%- endtrans %}
      {%- else %}
        {% trans copyright=copyright|e -%}
          Copyright &#169; {{ copyright }}
        {%- endtrans %}
      {%- endif %}
    </div>
    {%- endif %}

    {# mod: removed "Made with" #}

    {%- if last_updated -%}
    <div class="last-updated">
      {% trans last_updated=last_updated|e -%}
        Last updated on {{ last_updated }}
      {%- endtrans -%}
    </div>
    {%- endif %}

    {%- if show_source and has_source and sourcename %}
    <div class="show-source">
      <a class="muted-link" href="{{ pathto('_sources/' + sourcename, true)|e }}"
         rel="nofollow">Show source</a>
    </div>
    {%- endif %}
  </div>
  <div>
    {% if github_url and github_folder and pagename and page_source_suffix and display_contributors %}
        {% set contributors = get_contribs(github_url, github_folder, pagename, page_source_suffix, display_contributors_since) %}
        {% if contributors %}
          {% if contributors | length > 1 %}
              <a class="display-contributors">Thanks to the {{ contributors |length }} contributors!</a>
          {% else %}
              <a class="display-contributors">Thanks to our contributor!</a>
          {% endif %}
          <div id="overlay"></div>
          <ul class="all-contributors">
              {% for contributor in contributors %}
                  <li>
                      <a href="{{ contributor['github_page'] }}" class="contributor">{{ contributor['name'] }}</a>
                  </li>
              {% endfor %}
          </ul>
        {% endif %}
    {% endif %}
  </div>
  <div class="right-details">

    {# mod: replaced RTD icons with our links #}

    {% if discourse %}
    <div class="ask-discourse">
      <a class="muted-link" href="{{ discourse }}">Ask a question on Discourse</a>
    </div>
    {% endif %}

    {% if mattermost %}
    <div class="ask-mattermost">
      <a class="muted-link" href="{{ mattermost }}">Ask a question on Mattermost</a>
    </div>
    {% endif %}

    {% if matrix %}
    <div class="ask-matrix">
      <a class="muted-link" href="{{ matrix }}">Ask a question on Matrix</a>
    </div>
    {% endif %}

    {% if github_url and github_version and github_folder %}

    {% if github_issues %}
    <div class="issue-github">
      <a class="muted-link" href="{{ github_url }}/issues/new?title=doc%3A+ADD+A+TITLE&body=DESCRIBE+THE+ISSUE%0A%0A---%0ADocument: {{ pagename }}{{ page_source_suffix }}">Open a GitHub issue for this page</a>
    </div>
    {% endif %}

    <div class="edit-github">
      <a class="muted-link" href="{{ github_url }}/edit/{{ github_version }}{{ github_folder }}{{ pagename }}{{ page_source_suffix }}">Edit this page on GitHub</a>
    </div>
    {% endif %}


    </div>
  </div>
</div>
