Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{% extends "includes/crud/table_list.html" %}

{% load blocktrans trans from i18n %}
{% load trans blocktrans from i18n %}

{% block top_left_menu_items %}
{% endblock top_left_menu_items %}

{% block create_button %}
<a class="ui button" href="?download=true">
<i class="fa-duotone fa-download icon"></i>
{% trans "Download traffic data" %}
</a>
{% if objects %}
<a class="ui button" href="?download=true">
<i class="fa-duotone fa-download icon"></i>
{% trans "Download traffic data" %}
</a>
{% endif %}
{% endblock create_button %}

{% block list_placeholder_icon_class %}
Expand All @@ -23,11 +25,17 @@
{% blocktrans trimmed %}
Traffic data will be accumulated as readers view your documentation.
{% endblocktrans %}
{% if show_addons_link %}
{% url 'projects_addons' project.slug as addons_url %}
{% blocktrans with url=addons_url trimmed %}
Traffic analytics must be enabled in your project's <a href="{{ url }}">Addons settings</a>.
{% endblocktrans %}
{% endif %}
</div>
{% endblock list_placeholder_header %}
{% block list_placeholder_text %}
<a class="ui button"
href="https://docs.readthedocs.io/en/stable/analytics.html"
href="https://docs.readthedocs.io/en/stable/traffic-analytics.html"
aria-label="{% trans "Learn more about traffic analytics in our documentation" %}"
target="_blank">{% trans "Learn more" %}</a>
{% endblock list_placeholder_text %}
Expand Down
32 changes: 17 additions & 15 deletions readthedocsext/theme/templates/projects/traffic_analytics.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@
<div class="{% if not enabled %}ui basic fitted disabled segment{% endif %}"
data-bind="using: ProjectTrafficAnalyticsView()">

{% include "projects/partials/edit/traffic_list.html" with objects=top_pages_200 %}
{% include "projects/partials/edit/traffic_list.html" with objects=top_pages_200 show_addons_link=True %}

<h3 class="ui small header">
{% trans "Overview" %}
<div class="sub header">{% trans "For the last month" %}</div>
</h3>
{% if top_pages_200 %}
<h3 class="ui small header">
{% trans "Overview" %}
<div class="sub header">{% trans "For the last month" %}</div>
</h3>

<div class="ui loading segment" data-bind="css: {loading: is_loading()}">
<canvas width="400" height="150" data-bind="chart: config"></canvas>
<script type="application/json" data-bind="jsonInit: config">
<div class="ui loading segment" data-bind="css: {loading: is_loading()}">
<canvas width="400" height="150" data-bind="chart: config"></canvas>
<script type="application/json" data-bind="jsonInit: config">
{
"type": "line",
"data": {
Expand All @@ -62,14 +63,15 @@ <h3 class="ui small header">
}
}
}
</script>
</div>
</script>
</div>

<h3 class="ui small header">
{% trans "Not found pages (404)" %}
<div class="sub header">{% trans "For the last month" %}</div>
</h3>
{% include "projects/partials/edit/traffic_list.html" with objects=top_pages_404 %}
<h3 class="ui small header">
{% trans "Not found pages (404)" %}
<div class="sub header">{% trans "For the last month" %}</div>
</h3>
{% include "projects/partials/edit/traffic_list.html" with objects=top_pages_404 %}
{% endif %}

</div>
{% endblock project_edit_content %}
Expand Down