Skip to content

Commit

Permalink
Wrap versions' list to look more consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
stsewd committed Feb 16, 2018
1 parent a79534b commit 0ca31d8
Showing 1 changed file with 79 additions and 68 deletions.
147 changes: 79 additions & 68 deletions readthedocs/templates/projects/project_version_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,45 +21,52 @@

<div class="module project-versions-active">
<div class="module-wrapper">
<h1>{% trans "Active Versions" %}</h1>
<div class="module-list-wrapper">
<ul>
{% for version in active_versions|sort_version_aware %}
{% block active-versions %}
<li class="module-item">
{# Link to the docs #}
<a class="module-item-title" href="{{ version.get_absolute_url }}">{{ version.slug }}</a>

{% if request.user|is_admin:project %}
<span class="right-menu">
{{ version.get_privacy_level_display }}
</span>
{% endif %}

{% if not version.slug in version.identifier %}
<span class="right-menu quiet version-branch">{{ version.identifier_friendly|truncatechars:24 }}</span>
{% endif %}

{% if request.user|is_admin:project %}
<ul class="module-item-menu">
<li><a href="{% url "project_version_detail" project.slug version.slug %}">{% trans "Edit" %}</a></li>
</ul>
{% else %}
<ul class="module-item-menu">
<li><a href="{{ version.get_absolute_url }}">{% trans "View Docs" %}</a></li>
</ul>
{% endif %}

</li>
{% endblock active-versions %}

{% empty %}
<p>
{% trans "No active versions." %}
</p>
{% endfor %}
</ul>

<div class="module-header">
<h1>{% trans "Active Versions" %}</h1>
</div>

<div class="module-list">
<div class="module-list-wrapper">
<ul>
{% for version in active_versions|sort_version_aware %}
{% block active-versions %}
<li class="module-item">
{# Link to the docs #}
<a class="module-item-title" href="{{ version.get_absolute_url }}">{{ version.slug }}</a>

{% if request.user|is_admin:project %}
<span class="right-menu">
{{ version.get_privacy_level_display }}
</span>
{% endif %}

{% if not version.slug in version.identifier %}
<span class="right-menu quiet version-branch">{{ version.identifier_friendly|truncatechars:24 }}</span>
{% endif %}

{% if request.user|is_admin:project %}
<ul class="module-item-menu">
<li><a href="{% url "project_version_detail" project.slug version.slug %}">{% trans "Edit" %}</a></li>
</ul>
{% else %}
<ul class="module-item-menu">
<li><a href="{{ version.get_absolute_url }}">{% trans "View Docs" %}</a></li>
</ul>
{% endif %}

</li>
{% endblock active-versions %}

{% empty %}
<p>
{% trans "No active versions." %}
</p>
{% endfor %}
</ul>
</div>
</div>

</div>
</div>

Expand All @@ -68,42 +75,46 @@ <h1>{% trans "Active Versions" %}</h1>
<div class="module-wrapper">

{% if inactive_versions %}
<h1>{% trans "Inactive Versions" %}</h1>
<div class="module-list-wrapper">
<ul>
{% for version in inactive_versions|sort_version_aware %}
<div class="module-header">
<h1>{% trans "Inactive Versions" %}</h1>
</div>

{% block inactive-versions %}
<li class="module-item">
{# Link to the docs #}
<span class="quiet">{{ version.slug }}</span>
<div class="module-list">
<div class="module-list-wrapper">
<ul>
{% for version in inactive_versions|sort_version_aware %}

{% block inactive-versions %}
<li class="module-item">
{# Link to the docs #}
<span class="quiet">{{ version.slug }}</span>

{% if request.user|is_admin:project %}
<span class="right-menu">
{{ version.get_privacy_level_display }}
</span>
{% endif %}

{% if not version.slug in version.identifier_friendly %}
<span class="right-menu quiet version-branch">{{ version.identifier_friendly|truncatechars:24 }}</span>
{% endif %}
{% if request.user|is_admin:project %}
<span class="right-menu">
{{ version.get_privacy_level_display }}
</span>
{% endif %}

{% 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>
{% if not version.slug in version.identifier_friendly %}
<span class="right-menu quiet version-branch">{{ version.identifier_friendly|truncatechars:24 }}</span>
{% endif %}
<li><a href="{% url "project_version_detail" project.slug version.slug %}">{% trans "Edit" %}</a></li>
</ul>
{% endif %}


</li>
{% endblock inactive-versions %}

{% endfor %}
</ul>

{% 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 %}

</li>
{% endblock inactive-versions %}

{% endfor %}
</ul>
</div>
</div>
{% endif %}

Expand Down

0 comments on commit 0ca31d8

Please sign in to comment.