Skip to content

Removed unused code from view and template (#6250) #6288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 16, 2019
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
10 changes: 0 additions & 10 deletions readthedocs/projects/views/public.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,10 @@ def get_queryset(self):
self.tag = get_object_or_404(Tag, slug=self.kwargs.get('tag'))
queryset = queryset.filter(tags__slug__in=[self.tag.slug])

if self.kwargs.get('username'):
self.user = get_object_or_404(
User,
username=self.kwargs.get('username'),
)
queryset = queryset.filter(user=self.user)
else:
self.user = None

return queryset

def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['person'] = self.user
context['tag'] = self.tag
return context

Expand Down
28 changes: 2 additions & 26 deletions readthedocs/templates/projects/project_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,13 @@
{% load pagination_tags %}

{% block title %}
{% if person %}
{% if tag %}
{% blocktrans with person.username as username and tag.name as tag %}Projects by {{ username }} tagged with {{ tag }}{% endblocktrans %}
{% else %}
{% blocktrans with person.username as username %}Projects by {{ username }}{% endblocktrans %}
{% endif %}
{% else %}
{% if tag %}
{% blocktrans with tag.name as tag %}Projects tagged with {{ tag }}{% endblocktrans %}
{% else %}
{% trans "Projects" %}
{% endif %}
{% endif %}
{% blocktrans with tag.name as tag %}Projects tagged with {{ tag }}{% endblocktrans %}
{% endblock %}

{% block nav-browse %}class="active"{% endblock %}

{% block content-header %}
{% if person %}
{% if tag %}
<h1>{% blocktrans with person.username as username and tag.name as tag %}Projects by {{ username }} tagged with {{ tag }}{% endblocktrans %}</h1>
{% else %}
<h1>{% blocktrans with person.username as username %}Projects by {{ username }}{% endblocktrans %}</h1>
{% endif %}
{% else %}
{% if tag %}
<h1>{% blocktrans with tag.name as tag %}Projects tagged with {{ tag }}{% endblocktrans %}</h1>
{% else %}
<h1>{% trans "Projects" %}</h1>
{% endif %}
{% endif %}
<h1>{% blocktrans with tag.name as tag %}Projects tagged with {{ tag }}{% endblocktrans %}</h1>
{% endblock %}

{% block content %}
Expand Down