Skip to content
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

Wrap versions' list to look more consistent #3445

Merged
merged 3 commits into from
Jun 6, 2018
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
8 changes: 5 additions & 3 deletions readthedocs/templates/core/project_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ <h3>{% trans "Versions" %}</h3>
</li>

{% empty %}
<p>
{% trans "No active versions." %}
</p>
<li class="module-item">
<p class="quiet">
{% trans "No active versions." %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we considering this as a list of 1 element if it's empty?

I mean, we are using a li and displaying it as a row when it's not a list. In another comment I suggested to use just the simple text:

"No active versions."

as a p without too much style.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice reply! Hehe!

Makes sense to leave as you did, then :)

</p>
</li>
{% endfor %}
</ul>
</div>
Expand Down
6 changes: 4 additions & 2 deletions readthedocs/templates/core/project_downloads.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
{% endif %}

{% empty %}
<p>
{% trans "No downloads for this project." %}
<li class="module-item">
<p class="quiet">
{% trans "No downloads for this project." %}
</p>
</li>
{% endfor %}
2 changes: 1 addition & 1 deletion readthedocs/templates/projects/integration_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</ul>
</div>

<div class="module">
<div class="module-list">
<div class="module-list-wrapper">
<ul>
{% for integration in object_list %}
Expand Down
147 changes: 80 additions & 67 deletions readthedocs/templates/projects/project_version_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,45 +21,54 @@

<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 %}
<li class="module-item">
<p class="quiet">
{% trans "No active versions." %}
</p>
</li>
{% endfor %}
</ul>
</div>
</div>

</div>
</div>

Expand All @@ -68,42 +77,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 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 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 %}
<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 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><a href="{% url "project_version_detail" project.slug version.slug %}">{% trans "Edit" %}</a></li>
</ul>
{% endif %}


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

{% endfor %}
</ul>
</li>
{% endblock inactive-versions %}
{% endfor %}
</ul>
</div>
</div>
{% endif %}

Expand Down