Skip to content

Commit d147839

Browse files
committed
Fixes readthedocs#6510 -- Removed the show_analytics checks from the template
This patch removes the check of `show_analytics` variable in `templates/projects/project_search_analytics.html` which were expected after fixing readthedocs#6447
1 parent 013f7be commit d147839

File tree

1 file changed

+31
-42
lines changed

1 file changed

+31
-42
lines changed

readthedocs/templates/projects/projects_search_analytics.html

+31-42
Original file line numberDiff line numberDiff line change
@@ -11,51 +11,40 @@
1111
{% block project_edit_content_header %}{% trans "Search Analytics" %}{% endblock %}
1212

1313
{% block project_edit_content %}
14-
{% if show_analytics %}
1514

16-
<h3>{% trans "Top queries" %}</h3>
17-
<div class="module-list">
18-
<div class="module-list-wrapper">
19-
<ul class="long-list-overflow">
20-
{% for query, count in queries %}
21-
<li class="module-item">
22-
{{ query }}
23-
<span class="right quiet">
24-
{{ count }} search{{ count|pluralize:"es" }}
25-
</span>
26-
</li>
27-
{% empty %}
28-
<li class="module-item">
29-
<p class="quiet">
30-
{% trans 'No date available.' %}
31-
</p>
32-
</li>
33-
{% endfor %}
34-
</ul>
35-
</div>
15+
<h3>{% trans "Top queries" %}</h3>
16+
<div class="module-list">
17+
<div class="module-list-wrapper">
18+
<ul class="long-list-overflow">
19+
{% for query, count in queries %}
20+
<li class="module-item">
21+
{{ query }}
22+
<span class="right quiet">
23+
{{ count }} search{{ count|pluralize:"es" }}
24+
</span>
25+
</li>
26+
{% empty %}
27+
<li class="module-item">
28+
<p class="quiet">
29+
{% trans 'No date available.' %}
30+
</p>
31+
</li>
32+
{% endfor %}
33+
</ul>
3634
</div>
35+
</div>
3736

38-
<br/>
39-
{% if query_count_of_1_month.labels and query_count_of_1_month.int_data %}
40-
<h2>{% trans "Overview of the past 1 month:" %}</h2>
41-
<canvas id="analytics-chart-last-7-days" width="400" height="150"></canvas>
42-
{% endif %}
43-
44-
<br />
45-
<form method="get">
46-
<button type="submit" name="download" value="true">{% trans "Download all data" %}</button>
47-
</form>
48-
{% else %}
49-
<p class="empty">
50-
{% blocktrans trimmed %}
51-
Hey there! This feature is currently in beta state and is available under a
52-
<a href='https://docs.readthedocs.io/page/guides/feature-flags.html#available-flags'>feature flag</a>.
53-
In case you want to test this feature and help giving us feedback,
54-
please contact us via
55-
<a href='https://github.com/readthedocs/readthedocs.org/issues/new?title=Request%20to%20enable%20SEARCH_ANALYTICS%20feature%20flag%20for%20project%20{{ project }}'>GitHub issues</a>.
56-
{% endblocktrans %}
57-
</p>
37+
<br/>
38+
{% if query_count_of_1_month.labels and query_count_of_1_month.int_data %}
39+
<h2>{% trans "Overview of the past 1 month:" %}</h2>
40+
<canvas id="analytics-chart-last-7-days" width="400" height="150"></canvas>
5841
{% endif %}
42+
43+
<br />
44+
<form method="get">
45+
<button type="submit" name="download" value="true">{% trans "Download all data" %}</button>
46+
</form>
47+
5948
{% endblock %}
6049

6150
{% block extra_scripts %}
@@ -70,7 +59,7 @@ <h2>{% trans "Overview of the past 1 month:" %}</h2>
7059

7160
{% block footerjs %}
7261

73-
{% if query_count_of_1_month.labels and query_count_of_1_month.int_data and show_analytics %}
62+
{% if query_count_of_1_month.labels and query_count_of_1_month.int_data %}
7463
// Line chart
7564
var line_chart = document.getElementById("analytics-chart-last-7-days").getContext("2d");
7665
var line_chart_labels = {{ query_count_of_1_month.labels|safe }};

0 commit comments

Comments
 (0)