Commit ea610b65 authored by Samuel GAIST's avatar Samuel GAIST Committed by Samuel GAIST

[statistics][templates] Simplify user usage

No reason to access the request that many time
when the user can be put directly in the context
used to render the template
parent 0b0a79b7
Pipeline #43086 passed with stage
in 15 minutes and 7 seconds
......@@ -21,17 +21,17 @@
{% endcomment %}
<div id="{{panel_id}}">
<div class="list-group">
<a class="list-group-item" href="{% if request.user.is_anonymous %}{% url 'experiments:public-list' %}{% else %}{% url 'experiments:list' request.user.username %}{% endif %}" title="Show experiments" data-toggle="tooltip" data-placement="left">Experiments <span class="badge">{{ totals.experiments }}</span></a>
<a class="list-group-item" href="{% if request.user.is_anonymous %}{% url 'toolchains:public-list' %}{% else %}{% url 'toolchains:list' request.user.username %}{% endif %}" title="Show toolchains" data-toggle="tooltip" data-placement="left">Toolchains <span class="badge">{{ totals.toolchains }}</span></a>
<a class="list-group-item" href="{% if request.user.is_anonymous %}{% url 'algorithms:public-list' %}{% else %}{% url 'algorithms:list' request.user.username %}{% endif %}" title="Show algorithms" data-toggle="tooltip" data-placement="left">Algorithms <span class="badge">{{ totals.algorithms }}</span></a>
<a class="list-group-item" href="{% if request.user.is_anonymous %}{% url 'libraries:public-list' %}{% else %}{% url 'libraries:list' request.user.username %}{% endif %}" title="Show libraries" data-toggle="tooltip" data-placement="left">Libraries <span class="badge">{{ totals.libraries }}</span></a>
<a class="list-group-item" href="{% if request.user.is_anonymous %}{% url 'dataformats:public-list' %}{% else %}{% url 'dataformats:list' request.user.username %}{% endif %}" title="Show dataformats" data-toggle="tooltip" data-placement="left">Dataformats <span class="badge">{{ totals.dataformats }}</span></a>
<a class="list-group-item" href="{% if request.user.is_anonymous %}{% url 'teams:public-list' %}{% else %}{% url 'teams:list' request.user.username %}{% endif %}" title="Show teams" data-toggle="tooltip" data-placement="left">Teams <span class="badge">{{ totals.teams }}</span></a>
<a class="list-group-item" href="{% if request.user.is_anonymous %}{% url 'attestations:public-list' %}{% else %}{% url 'attestations:list' request.user.username %}{% endif %}" title="Show attestations" data-toggle="tooltip" data-placement="left">Attestations <span class="badge">{{ totals.attestations }}</span></a>
<a class="list-group-item" href="{% if request.user.is_anonymous %}{% url 'search:public-list' %}{% else %}{% url 'search:list' request.user.username %}{% endif %}" title="Show searches" data-toggle="tooltip" data-placement="left">Searches <span class="badge">{{ totals.searches }}</span></a>
<a class="list-group-item" href="{% if request.user.is_anonymous %}{% url 'reports:public-list' %}{% else %}{% url 'reports:list' request.user.username %}{% endif %}" title="Show reports" data-toggle="tooltip" data-placement="left">Reports <span class="badge">{{ totals.reports }}</span></a>
<a class="list-group-item" href="{% if request.user.is_anonymous %}{% url 'plotters:list' %}{% else %}{% url 'plotters:list' %}{% endif %}" title="Show plotters" data-toggle="tooltip" data-placement="left">Plotters <span class="badge">{{ totals.plotters}}</span></a>
<a class="list-group-item" href="{% if request.user.is_anonymous %}{% url 'plotters:plotterparameter-public-list' %}{% else %}{% url 'plotters:plotterparameter-list' request.user.username %}{% endif %}" title="Show plotters" data-toggle="tooltip" data-placement="left">Plotterparameters <span class="badge">{{ totals.plotterparameters}}</span></a>
<a class="list-group-item" href="{% if user.is_anonymous %}{% url 'experiments:public-list' %}{% else %}{% url 'experiments:list' user.username %}{% endif %}" title="Show experiments" data-toggle="tooltip" data-placement="left">Experiments <span class="badge">{{ totals.experiments }}</span></a>
<a class="list-group-item" href="{% if user.is_anonymous %}{% url 'toolchains:public-list' %}{% else %}{% url 'toolchains:list' user.username %}{% endif %}" title="Show toolchains" data-toggle="tooltip" data-placement="left">Toolchains <span class="badge">{{ totals.toolchains }}</span></a>
<a class="list-group-item" href="{% if user.is_anonymous %}{% url 'algorithms:public-list' %}{% else %}{% url 'algorithms:list' user.username %}{% endif %}" title="Show algorithms" data-toggle="tooltip" data-placement="left">Algorithms <span class="badge">{{ totals.algorithms }}</span></a>
<a class="list-group-item" href="{% if user.is_anonymous %}{% url 'libraries:public-list' %}{% else %}{% url 'libraries:list' user.username %}{% endif %}" title="Show libraries" data-toggle="tooltip" data-placement="left">Libraries <span class="badge">{{ totals.libraries }}</span></a>
<a class="list-group-item" href="{% if user.is_anonymous %}{% url 'dataformats:public-list' %}{% else %}{% url 'dataformats:list' user.username %}{% endif %}" title="Show dataformats" data-toggle="tooltip" data-placement="left">Dataformats <span class="badge">{{ totals.dataformats }}</span></a>
<a class="list-group-item" href="{% if user.is_anonymous %}{% url 'teams:public-list' %}{% else %}{% url 'teams:list' user.username %}{% endif %}" title="Show teams" data-toggle="tooltip" data-placement="left">Teams <span class="badge">{{ totals.teams }}</span></a>
<a class="list-group-item" href="{% if user.is_anonymous %}{% url 'attestations:public-list' %}{% else %}{% url 'attestations:list' user.username %}{% endif %}" title="Show attestations" data-toggle="tooltip" data-placement="left">Attestations <span class="badge">{{ totals.attestations }}</span></a>
<a class="list-group-item" href="{% if user.is_anonymous %}{% url 'search:public-list' %}{% else %}{% url 'search:list' user.username %}{% endif %}" title="Show searches" data-toggle="tooltip" data-placement="left">Searches <span class="badge">{{ totals.searches }}</span></a>
<a class="list-group-item" href="{% if user.is_anonymous %}{% url 'reports:public-list' %}{% else %}{% url 'reports:list' user.username %}{% endif %}" title="Show reports" data-toggle="tooltip" data-placement="left">Reports <span class="badge">{{ totals.reports }}</span></a>
<a class="list-group-item" href="{% if user.is_anonymous %}{% url 'plotters:list' %}{% else %}{% url 'plotters:list' %}{% endif %}" title="Show plotters" data-toggle="tooltip" data-placement="left">Plotters <span class="badge">{{ totals.plotters}}</span></a>
<a class="list-group-item" href="{% if user.is_anonymous %}{% url 'plotters:plotterparameter-public-list' %}{% else %}{% url 'plotters:plotterparameter-list' user.username %}{% endif %}" title="Show plotters" data-toggle="tooltip" data-placement="left">Plotterparameters <span class="badge">{{ totals.plotterparameters}}</span></a>
<a class="list-group-item" href="{% url 'databases:list' %}" title="Show databases" data-toggle="tooltip" data-placement="left">Databases <span class="badge">{{ totals.databases }}</span></a>
<div class="list-group-item">Users <span class="badge">{{ totals.users }}</span></div>
</div>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment