Skip to content

Commit d2883f3

Browse files
committed
Wrap versions' list to look more consistent
1 parent 64def2d commit d2883f3

File tree

1 file changed

+79
-68
lines changed

1 file changed

+79
-68
lines changed

readthedocs/templates/projects/project_version_list.html

Lines changed: 79 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -21,45 +21,52 @@
2121

2222
<div class="module project-versions-active">
2323
<div class="module-wrapper">
24-
<h1>{% trans "Active Versions" %}</h1>
25-
<div class="module-list-wrapper">
26-
<ul>
27-
{% for version in active_versions|sort_version_aware %}
28-
{% block active-versions %}
29-
<li class="module-item">
30-
{# Link to the docs #}
31-
<a class="module-item-title" href="{{ version.get_absolute_url }}">{{ version.slug }}</a>
32-
33-
{% if request.user|is_admin:project %}
34-
<span class="right-menu">
35-
{{ version.get_privacy_level_display }}
36-
</span>
37-
{% endif %}
38-
39-
{% if not version.slug in version.identifier %}
40-
<span class="right-menu quiet version-branch">{{ version.identifier_friendly|truncatechars:24 }}</span>
41-
{% endif %}
42-
43-
{% if request.user|is_admin:project %}
44-
<ul class="module-item-menu">
45-
<li><a href="{% url "project_version_detail" project.slug version.slug %}">{% trans "Edit" %}</a></li>
46-
</ul>
47-
{% else %}
48-
<ul class="module-item-menu">
49-
<li><a href="{{ version.get_absolute_url }}">{% trans "View Docs" %}</a></li>
50-
</ul>
51-
{% endif %}
52-
53-
</li>
54-
{% endblock active-versions %}
55-
56-
{% empty %}
57-
<p>
58-
{% trans "No active versions." %}
59-
</p>
60-
{% endfor %}
61-
</ul>
24+
25+
<div class="module-header">
26+
<h1>{% trans "Active Versions" %}</h1>
6227
</div>
28+
29+
<div class="module-list">
30+
<div class="module-list-wrapper">
31+
<ul>
32+
{% for version in active_versions|sort_version_aware %}
33+
{% block active-versions %}
34+
<li class="module-item">
35+
{# Link to the docs #}
36+
<a class="module-item-title" href="{{ version.get_absolute_url }}">{{ version.slug }}</a>
37+
38+
{% if request.user|is_admin:project %}
39+
<span class="right-menu">
40+
{{ version.get_privacy_level_display }}
41+
</span>
42+
{% endif %}
43+
44+
{% if not version.slug in version.identifier %}
45+
<span class="right-menu quiet version-branch">{{ version.identifier_friendly|truncatechars:24 }}</span>
46+
{% endif %}
47+
48+
{% if request.user|is_admin:project %}
49+
<ul class="module-item-menu">
50+
<li><a href="{% url "project_version_detail" project.slug version.slug %}">{% trans "Edit" %}</a></li>
51+
</ul>
52+
{% else %}
53+
<ul class="module-item-menu">
54+
<li><a href="{{ version.get_absolute_url }}">{% trans "View Docs" %}</a></li>
55+
</ul>
56+
{% endif %}
57+
58+
</li>
59+
{% endblock active-versions %}
60+
61+
{% empty %}
62+
<p>
63+
{% trans "No active versions." %}
64+
</p>
65+
{% endfor %}
66+
</ul>
67+
</div>
68+
</div>
69+
6370
</div>
6471
</div>
6572

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

7077
{% if inactive_versions %}
71-
<h1>{% trans "Inactive Versions" %}</h1>
72-
<div class="module-list-wrapper">
73-
<ul>
74-
{% for version in inactive_versions|sort_version_aware %}
78+
<div class="module-header">
79+
<h1>{% trans "Inactive Versions" %}</h1>
80+
</div>
7581

76-
{% block inactive-versions %}
77-
<li class="module-item">
78-
{# Link to the docs #}
79-
<span class="quiet">{{ version.slug }}</span>
82+
<div class="module-list">
83+
<div class="module-list-wrapper">
84+
<ul>
85+
{% for version in inactive_versions|sort_version_aware %}
8086

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

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

88-
{% if not version.slug in version.identifier_friendly %}
89-
<span class="right-menu quiet version-branch">{{ version.identifier_friendly|truncatechars:24 }}</span>
90-
{% endif %}
93+
{% if request.user|is_admin:project %}
94+
<span class="right-menu">
95+
{{ version.get_privacy_level_display }}
96+
</span>
97+
{% endif %}
9198

92-
{% if request.user|is_admin:project %}
93-
<ul class="module-item-menu">
94-
{% if version.built %}
95-
<li><a href="{% url "project_version_delete_html" project.slug version.slug %}">{% trans "Clean" %}</a></li>
99+
{% if not version.slug in version.identifier_friendly %}
100+
<span class="right-menu quiet version-branch">{{ version.identifier_friendly|truncatechars:24 }}</span>
96101
{% endif %}
97-
<li><a href="{% url "project_version_detail" project.slug version.slug %}">{% trans "Edit" %}</a></li>
98-
</ul>
99-
{% endif %}
100-
101-
102-
</li>
103-
{% endblock inactive-versions %}
104-
105-
{% endfor %}
106-
</ul>
102+
103+
{% if request.user|is_admin:project %}
104+
<ul class="module-item-menu">
105+
{% if version.built %}
106+
<li><a href="{% url "project_version_delete_html" project.slug version.slug %}">{% trans "Clean" %}</a></li>
107+
{% endif %}
108+
<li><a href="{% url "project_version_detail" project.slug version.slug %}">{% trans "Edit" %}</a></li>
109+
</ul>
110+
{% endif %}
111+
112+
</li>
113+
{% endblock inactive-versions %}
114+
115+
{% endfor %}
116+
</ul>
117+
</div>
107118
</div>
108119
{% endif %}
109120

0 commit comments

Comments
 (0)