Skip to content

Commit

Permalink
Move version "Clean" button to details page
Browse files Browse the repository at this point in the history
Instead of showing the "Clean" button next to a version in the
listing, this button is moved to the detail page with an explanation
about what it does.
  • Loading branch information
humitos committed May 17, 2019
1 parent 616a303 commit 1a8ea0d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
15 changes: 15 additions & 0 deletions readthedocs/templates/projects/project_version_detail.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends "projects/base_project.html" %}

{% load i18n %}
{% load privacy_tags %}

{% block title %}{{ version.slug }} - {{ version.project.name }}{% endblock %}

Expand All @@ -15,6 +16,20 @@

{% block content %}
<h2> Editing {{ version.slug }} </h2>

{% if request.user|is_admin:project %}
{% if not version.active and version.built %}
<p class="empty">
{% url "project_version_delete_html" project.slug version.slug as version_delete_url %}
{% blocktrans %}
This version is inactive but its documentation is still available online.
You can <a href="{{ version_delete_url }}">delete this version completely</a> if you want to remove it completely.
{% endblocktrans %}
</p>
{% endif %}
{% endif %}


<form method="post" action=".">
{% csrf_token %}
{{ form.as_p }}
Expand Down
3 changes: 0 additions & 3 deletions readthedocs/templates/projects/project_version_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ <h1>{% trans "Inactive Versions" %}</h1>

{% if request.user|is_admin:project %}
<ul class="module-item-menu">
{% if version.built %}
<li><a href="{% url "project_version_delete_html" project.slug version.slug %}">{% trans "Clean" %}</a></li>
{% endif %}
<li><a href="{% url "project_version_detail" project.slug version.slug %}">{% trans "Edit" %}</a></li>
</ul>
{% endif %}
Expand Down

0 comments on commit 1a8ea0d

Please sign in to comment.