Skip to content

Commit

Permalink
improve version listing
Browse files Browse the repository at this point in the history
  • Loading branch information
bansalnitish committed Mar 8, 2018
1 parent a5675c5 commit cb30e4f
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 183 deletions.
4 changes: 4 additions & 0 deletions media/css/core.css
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ div.menu-user div.menu-dropdown.menu-dropped {
opacity: 1;
}

/* version-property */

.version-property { border-color: #E6E6E6; padding: 5px; border-style: solid; background-color: white; border-width: 8px 8px 6px 8px; }

/* home */

#home-header { background: url(../images/header-home-bg.svg) top left repeat #465158; border-bottom: 1px solid #333; padding: 65px 0 35px 0; color: #fff; }
Expand Down
5 changes: 5 additions & 0 deletions readthedocs/builds/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ def get_conf_py_path(self):
conf_py_path = os.path.relpath(conf_py_path, checkout_prefix)
return conf_py_path

def get_build(self):
project = Project.objects.get(slug=self.project)
build = Build.objects.filter(project=self.project, version=self).first()
return build

def get_build_path(self):
"""Return version build path if path exists, otherwise `None`."""
path = self.project.checkout_path(version=self.slug)
Expand Down
20 changes: 0 additions & 20 deletions readthedocs/gold/migrations/0002_auto_20180307_0807.py

This file was deleted.

56 changes: 0 additions & 56 deletions readthedocs/integrations/migrations/0003_auto_20180307_0807.py

This file was deleted.

54 changes: 0 additions & 54 deletions readthedocs/projects/migrations/0024_auto_20180307_0807.py

This file was deleted.

20 changes: 0 additions & 20 deletions readthedocs/redirects/migrations/0002_auto_20180307_0807.py

This file was deleted.

64 changes: 31 additions & 33 deletions readthedocs/templates/core/project_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
<div class="module-header">
<h3>{% trans "Versions" %}</h3>
</div>

{% for version in versions|sort_version_aware %}
<br>

{% for version in versions|sort_version_aware %}
<h4>
{% if version.uploaded or version.built %}
<span>
{% if version.uploaded or version.built %}
{# Link to the docs #}
<a class="module-item-title" href="{{ version.get_absolute_url }}">
{{ version.slug }}
Expand All @@ -30,42 +32,37 @@ <h4>
<a class="module-item-title" href="{{ version.project.get_builds_url }}">
{{ version.slug }}
</a>
{% 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>
{% endif %}
{% endif %}
{% if request.user|is_admin:project %}
<a class ="right-menu quiet" href="{% url "project_version_detail" project.slug version.slug %}">{% trans "Edit" %}</a>
{% endif %}
</span>
</h4>

<ul>
<li>
{% if request.user in project.users.all %}
Privacy level: {{ version.get_privacy_level_display }}
{% endif %}
</li>
<li>
Build state: {% if version.get_build.success %} Success {% else %} Failed {% endif %}
</li>
<li>
Build date: {{ version.get_build.date }}
<li>
Branch name: {% if not version.slug in version.identifier %}
{{ version.identifier_friendly|truncatechars:24 }}
{% endif %}
}
</li>
</ul>


<li class="version-property">
Latest build state: {% if version.get_build.success %} Passed {% else %} Failed {% endif %}
</li>
<li class="version-property">
Latest build date: {{ version.get_build.date }}
</li>
<li class="version-property">
{% if request.user in project.users.all %}
Privacy: {{ version.get_privacy_level_display }}
{% endif %}
</li>
<li class="version-property">
{% if not version.slug in version.identifier %}
Branch: {{ version.identifier_friendly|truncatechars:24 }}
{% endif %}
</li>
<br>
<br>
{% empty %}
<p>
{% trans "No active versions." %}
</p>
{% endfor %}
</ul>
</div>
</div>
</ul>
{% endfor %}

{% block build_versions %}
{% if versions and request.user|is_admin:project %}
Expand All @@ -86,6 +83,7 @@ <h3>{% trans "Build a version" %}</h3>
{% endif %}
{% endblock %}


</div>{# END .module #}

<div class="project_details">
Expand Down

0 comments on commit cb30e4f

Please sign in to comment.