{% extends "user/edit_base.html" %}

{% block add_action_content %}
  {% if h.check_access('package_create') %}
    <li>{% link_for _('Add Dataset'), controller='package', action='new', class_="btn btn-primary", icon="plus-sign-alt" %}</li>
  {% endif %}
{% endblock %}

{% block primary_content_inner %}
  <div data-module="dashboard">
    {% snippet 'user/snippets/followee_dropdown.html', context=c.dashboard_activity_stream_context, followees=c.followee_list %}
    <h2 class="page-heading">
      {{ _('News feed') }}
      <small>{{ _('Activity from items that you follow') }}</small>
    </h2>
    {{ c.dashboard_activity_stream }}
  </div>
{% endblock %}

{% block secondary_content %}
  {% if not c.dashboard_activity_stream_context.dict == None %}
    <div class="context-info dashboard-context">
      <span class="arrow"></span>
      {% snippet 'snippets/context.html', type=c.dashboard_activity_stream_context.filter_type, dict=c.dashboard_activity_stream_context.dict %}
    </div>
  {% endif %}
  <div class="module module-narrow module-shallow">
    <h2 class="module-heading">
      <i class="icon-sitemap"></i>
      {{ _('My Datasets') }}
    </h2>
    {% if c.user_dict['datasets'] %}
      <ul class="nav nav-simple">
        {% for package in c.user_dict['datasets'] %}
          {% set title = package.title or package.name %}
          <li class="nav-item">
            {{ h.link_to(h.truncate(title, 80), h.url_for(controller='package', action='read', id=package.name)) }}
          </li>
        {% endfor %}
      </ul>
    {% else %}
      <div class="module-content">
        <p class="empty">{{ _('You do not have any datasets') }}</p>
      </div>
    {% endif %}
  </div>
{% endblock %}
