From fb5e5bbaf013ec9481acd2a6cdd17acd79685375 Mon Sep 17 00:00:00 2001
From: Eric Holscher
Date: Sun, 3 Dec 2017 14:12:46 -0800
Subject: [PATCH 1/5] Try and get folks to put more tags.
---
readthedocs/projects/forms.py | 2 +-
readthedocs/templates/core/project_detail_right.html | 9 +++++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/readthedocs/projects/forms.py b/readthedocs/projects/forms.py
index 6e83ddcb83c..0e374bed046 100644
--- a/readthedocs/projects/forms.py
+++ b/readthedocs/projects/forms.py
@@ -161,8 +161,8 @@ class Meta(object):
'documentation_type',
'language',
'programming_language',
- 'project_url',
'tags',
+ 'project_url',
)
description = forms.CharField(
diff --git a/readthedocs/templates/core/project_detail_right.html b/readthedocs/templates/core/project_detail_right.html
index 0b3f3b6a2cd..befb3feb105 100644
--- a/readthedocs/templates/core/project_detail_right.html
+++ b/readthedocs/templates/core/project_detail_right.html
@@ -61,16 +61,21 @@ {% trans "Badge" %}
{% block tags %}
- {% if project.tags.count %}
{% trans "Tags" %}
+ {% if project.tags.count %}
{% for tag in project.tags.all %}
{{ tag.name }}{% if forloop.last %}{% else %}, {% endif %}
{% empty %}
{% trans "No tags" %}
{% endfor %}
-
+ {% else %}
+ Project has no tags.
+ {% if request.user|is_admin:project %}
+ Add some in your project settings.
+ {% endif %}
{% endif %}
+
{% endblock %}
{% block privacy-level %}
From 91c6387cc44e82fd2f392c052f95f4d6509d6822 Mon Sep 17 00:00:00 2001
From: Eric Holscher
Date: Sun, 3 Dec 2017 14:51:16 -0800
Subject: [PATCH 2/5] Fix docs
---
docs/contribute.rst | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/contribute.rst b/docs/contribute.rst
index b8ea5c9adf8..00c1563f7cd 100644
--- a/docs/contribute.rst
+++ b/docs/contribute.rst
@@ -71,6 +71,7 @@ command will be run immediately and will inform you of the changes and errors.
.. _Sprintable: https://github.com/rtfd/readthedocs.org/issues?q=is%3Aopen+is%3Aissue+label%3ASprintable
.. _contribution-guide.org: http://www.contribution-guide.org/#submitting-bugs
+.. _pre-commit: https://github.com/pre-commit/pre-commit
.. _autoflake: https://github.com/myint/autoflake
.. _autopep8: https://github.com/hhatto/autopep8
.. _docformatter: https://github.com/myint/docformatter
From 3967f071f4c648f2249762959e88b9d3ef1ac4a3 Mon Sep 17 00:00:00 2001
From: Eric Holscher
Date: Tue, 5 Dec 2017 08:35:07 -0800
Subject: [PATCH 3/5] Fix translation
---
readthedocs/settings/test.py | 6 ++++++
.../templates/core/project_detail_right.html | 15 ++++++++-------
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/readthedocs/settings/test.py b/readthedocs/settings/test.py
index 84e6eeda63e..10c2946c10e 100644
--- a/readthedocs/settings/test.py
+++ b/readthedocs/settings/test.py
@@ -17,6 +17,12 @@ class CommunityTestSettings(CommunityDevSettings):
DEBUG = False
TEMPLATE_DEBUG = False
+ @property
+ def LOGGING(self): # noqa - avoid pep8 N802
+ logging = super(CommunityDevSettings, self).LOGGING
+ return logging
+
+
CommunityTestSettings.load_settings(__name__)
diff --git a/readthedocs/templates/core/project_detail_right.html b/readthedocs/templates/core/project_detail_right.html
index befb3feb105..6fa4c0d614e 100644
--- a/readthedocs/templates/core/project_detail_right.html
+++ b/readthedocs/templates/core/project_detail_right.html
@@ -24,10 +24,10 @@ {% trans "Last Built" %}
{% trans "failed" %}
{% endif %}
{% else %}
- Currently Building
+ {% trans "Currently Building" %}
{% endif %}
{% else %}
- No builds yet
+ {% trans "No builds yet" %}
{% endif %}
{% endwith %}
@@ -66,13 +66,14 @@ {% trans "Tags" %}
{% if project.tags.count %}
{% for tag in project.tags.all %}
{{ tag.name }}{% if forloop.last %}{% else %}, {% endif %}
- {% empty %}
- {% trans "No tags" %}
- {% endfor %}
{% else %}
- Project has no tags.
+ {% trans "Project has no tags." %}
{% if request.user|is_admin:project %}
- Add some in your project settings.
+
+ {% url 'projects_edit' project.slug as edit_url %}
+ {% blocktrans %}
+ Add some in your project settings.
+ {% endblocktrans %}
{% endif %}
{% endif %}
From ce5932ec0ae87f936075a24d1a6eb99bab26d7d2 Mon Sep 17 00:00:00 2001
From: Eric Holscher
Date: Tue, 5 Dec 2017 08:36:12 -0800
Subject: [PATCH 4/5] And template
---
.../templates/core/project_detail_right.html | 27 ++++++++++---------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/readthedocs/templates/core/project_detail_right.html b/readthedocs/templates/core/project_detail_right.html
index 6fa4c0d614e..d94b556d164 100644
--- a/readthedocs/templates/core/project_detail_right.html
+++ b/readthedocs/templates/core/project_detail_right.html
@@ -63,19 +63,22 @@ {% trans "Badge" %}
{% block tags %}
{% trans "Tags" %}
- {% if project.tags.count %}
- {% for tag in project.tags.all %}
- {{ tag.name }}{% if forloop.last %}{% else %}, {% endif %}
- {% else %}
- {% trans "Project has no tags." %}
- {% if request.user|is_admin:project %}
-
- {% url 'projects_edit' project.slug as edit_url %}
- {% blocktrans %}
- Add some in your project settings.
- {% endblocktrans %}
+
+ {% if project.tags.count %}
+ {% for tag in project.tags.all %}
+ {{ tag.name }}{% if forloop.last %}{% else %}, {% endif %}
+ {% endfor %}
+ {% else %}
+ {% trans "Project has no tags." %}
+ {% if request.user|is_admin:project %}
+
+ {% url 'projects_edit' project.slug as edit_url %}
+ {% blocktrans %}
+ Add some in your project settings.
+ {% endblocktrans %}
+ {% endif %}
{% endif %}
- {% endif %}
+
{% endblock %}
From 5a5a906949ab9abb273dd74179eede1b4f39ce9d Mon Sep 17 00:00:00 2001
From: Eric Holscher
Date: Tue, 5 Dec 2017 08:46:43 -0800
Subject: [PATCH 5/5] s/count/exists/
---
readthedocs/templates/core/project_detail_right.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/readthedocs/templates/core/project_detail_right.html b/readthedocs/templates/core/project_detail_right.html
index d94b556d164..b3e3e9dca00 100644
--- a/readthedocs/templates/core/project_detail_right.html
+++ b/readthedocs/templates/core/project_detail_right.html
@@ -64,7 +64,7 @@ {% trans "Badge" %}
{% trans "Tags" %}
- {% if project.tags.count %}
+ {% if project.tags.exists %}
{% for tag in project.tags.all %}
{{ tag.name }}{% if forloop.last %}{% else %}, {% endif %}
{% endfor %}