{% extends base %}

{% block body_left %}

{% init parent_link = None %}
{% init title_link = None %}
{% init type = "ctime" %}
{% init base_path = "/note/timeline" %}
{% init key = "" %}
{% init show_old_create = False %}
{% init show_create_btn = False %}
{% init show_recent_btn = False %}
{% init show_back_btn = False %}
{% init show_group_btn = False %}

<div class="card">
  <div class="note-header card-title">
    <span class="note-header-span">{{title}}</span>

    <div class="float-right">
        {% if show_old_create %}
          <!-- 原来使用 create_option.html 弹窗创建并没有预期的方便，而且不好做扩展 -->
          {% include note/component/timeline/timeline_create_option.html %}
        {% end %}

        {% if type == "all" %}
          <!-- 最近的笔记 -->
          <a class="btn btn-default" href="{{_server_home}}/note/group?type=year">笔记日历</a>
          <a href="{{_server_home}}/note/timeline?type=group_list&orderby=name" class="btn btn-default">笔记本</a>
        {% end %}

        {% if type == "year_group" %}
          <!-- 笔记日历视图 -->
          <a class="btn btn-default" href="{{_server_home}}/note/group?type=year">笔记日历</a>
        {% end %}

        {% if type == "group" %}
          <!-- 笔记本视图 -->
          <a class="btn" href="{{_server_home}}/note/create?parent_id={{parent_id}}">新建笔记</a>
        {% end %}

        {% if type == "group_list" %}
          <!-- 笔记本视图 -->
          <a href="{{_server_home}}/note/timeline?type=all" class="btn btn-default">最新笔记</a>
        {% end %}

        {% if type == "default" %}
          <!-- 笔记列表视图 -->
          <a class="btn" href="{{_server_home}}/note/create?parent_id={{parent_id}}">新建笔记</a>
          {% include note/component/option/group_option.html %}
        {% end %}
        
        {% if type == "public" %}
          {% include note/component/share_dialog.html %}
        {% end %}

        {% include common/button/back_button.html %}
    </div>
  </div>
</div>

{% if len(pathlist) > 1 %}
<div class="card">
  {% include note/component/note_path.html %}
</div>
{% end %}


{% include note/component/timeline/timeline_body.html %}

{% end %}

{% block body_right %}
    {% include note/component/sidebar/group_list_sidebar.html %}
{% end %}