Skip to content

Commit 7f01c6c

Browse files
authored
Merge pull request #3445 from stsewd/consistent-sections
Wrap versions' list to look more consistent
2 parents bc7e645 + 7b7ecb3 commit 7f01c6c

File tree

4 files changed

+90
-73
lines changed

4 files changed

+90
-73
lines changed

readthedocs/templates/core/project_details.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@ <h3>{% trans "Versions" %}</h3>
4646
</li>
4747

4848
{% empty %}
49-
<p>
50-
{% trans "No active versions." %}
51-
</p>
49+
<li class="module-item">
50+
<p class="quiet">
51+
{% trans "No active versions." %}
52+
</p>
53+
</li>
5254
{% endfor %}
5355
</ul>
5456
</div>

readthedocs/templates/core/project_downloads.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
{% endif %}
2727

2828
{% empty %}
29-
<p>
30-
{% trans "No downloads for this project." %}
29+
<li class="module-item">
30+
<p class="quiet">
31+
{% trans "No downloads for this project." %}
3132
</p>
33+
</li>
3234
{% endfor %}

readthedocs/templates/projects/integration_list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</ul>
2424
</div>
2525

26-
<div class="module">
26+
<div class="module-list">
2727
<div class="module-list-wrapper">
2828
<ul>
2929
{% for integration in object_list %}

readthedocs/templates/projects/project_version_list.html

Lines changed: 80 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -21,45 +21,54 @@
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+
<li class="module-item">
63+
<p class="quiet">
64+
{% trans "No active versions." %}
65+
</p>
66+
</li>
67+
{% endfor %}
68+
</ul>
69+
</div>
70+
</div>
71+
6372
</div>
6473
</div>
6574

@@ -68,42 +77,46 @@ <h1>{% trans "Active Versions" %}</h1>
6877
<div class="module-wrapper">
6978

7079
{% 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 %}
80+
<div class="module-header">
81+
<h1>{% trans "Inactive Versions" %}</h1>
82+
</div>
7583

76-
{% block inactive-versions %}
77-
<li class="module-item">
78-
{# Link to the docs #}
79-
<span class="quiet">{{ version.slug }}</span>
84+
<div class="module-list">
85+
<div class="module-list-wrapper">
86+
<ul>
87+
{% for version in inactive_versions|sort_version_aware %}
88+
89+
{% block inactive-versions %}
90+
<li class="module-item">
91+
{# Link to the docs #}
92+
<span class="quiet">{{ version.slug }}</span>
8093

8194

82-
{% if request.user|is_admin:project %}
83-
<span class="right-menu">
84-
{{ version.get_privacy_level_display }}
85-
</span>
86-
{% endif %}
95+
{% if request.user|is_admin:project %}
96+
<span class="right-menu">
97+
{{ version.get_privacy_level_display }}
98+
</span>
99+
{% endif %}
87100

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 %}
101+
{% if not version.slug in version.identifier_friendly %}
102+
<span class="right-menu quiet version-branch">{{ version.identifier_friendly|truncatechars:24 }}</span>
103+
{% endif %}
91104

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>
105+
{% if request.user|is_admin:project %}
106+
<ul class="module-item-menu">
107+
{% if version.built %}
108+
<li><a href="{% url "project_version_delete_html" project.slug version.slug %}">{% trans "Clean" %}</a></li>
109+
{% endif %}
110+
<li><a href="{% url "project_version_detail" project.slug version.slug %}">{% trans "Edit" %}</a></li>
111+
</ul>
96112
{% endif %}
97-
<li><a href="{% url "project_version_detail" project.slug version.slug %}">{% trans "Edit" %}</a></li>
98-
</ul>
99-
{% endif %}
100113

101-
102-
</li>
103-
{% endblock inactive-versions %}
104-
105-
{% endfor %}
106-
</ul>
114+
</li>
115+
{% endblock inactive-versions %}
116+
117+
{% endfor %}
118+
</ul>
119+
</div>
107120
</div>
108121
{% endif %}
109122

0 commit comments

Comments
 (0)