-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Version page should show build status + not being able to pick a non-built doc #5169
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
Changes from 10 commits
968c288
5d60dce
9da72f5
c20509e
ca1ff6e
ff82284
1ea7411
8374601
41eda6e
dbc9bbe
b932506
d975428
d9651ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from django import template | ||
|
||
|
||
register = template.Library() | ||
|
||
|
||
@register.simple_tag | ||
def is_latest_built_success(version): | ||
""" | ||
Checks the build status of the passed version. | ||
|
||
Returns true if the latest build for the ``version`` | ||
is success else returns false. Returns None if no | ||
build is found for the given version. | ||
""" | ||
res = version.builds.all().order_by('-date').values_list('success', flat=True) | ||
if res.exists(): | ||
return res.first() |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
{% load privacy_tags %} | ||
{% load gravatar %} | ||
{% load projects_tags %} | ||
{% load builds_tags %} | ||
|
||
<div id="project_details"> | ||
<div class="wrapper"> | ||
|
@@ -41,6 +42,16 @@ <h3>{% trans "Versions" %}</h3> | |
{% 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> | ||
<li> | ||
<span class="right quiet status-middle"> | ||
{% is_latest_built_success version as is_success %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should use this model method: https://github.com/rtfd/readthedocs.org/blob/master/readthedocs/projects/models.py#L882 -- it's likely much more efficient. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
{% if is_success %} | ||
<span class="build-state build-state-passing">{% trans "passing" %}</span> | ||
{% else %} | ||
<span class="build-state build-state-failing status-failing">{% trans "failing" %}</span> | ||
{% endif %} | ||
</span> | ||
<li> | ||
</ul> | ||
{% endif %} | ||
</li> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't use pixel margins like this, we can't guarantee the difference is 14px -- font differences, font size differences, and translated strings will all produce something other than 14px. the proper way to do this is to use a fixed block size as a parent element, which is independent of the text we're trying to separate. But there are still issues with translations in this case, so I'm generally against trying to fit more information into a coulmn format and that is why our design project is moving towards a multi-line row format for all tabular data like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, there are already styles for adding multiple elements in a single row like this, however you'll have to search for an example, I don't have one available. There are several dashboard forms that already use a three column approach.