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

Try and get folks to put more tags. #3350

Merged
merged 5 commits into from
Dec 5, 2017
Merged
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions docs/contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/projects/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ class Meta(object):
'documentation_type',
'language',
'programming_language',
'project_url',
'tags',
'project_url',
)

description = forms.CharField(
Expand Down
6 changes: 6 additions & 0 deletions readthedocs/settings/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)

Expand Down
27 changes: 18 additions & 9 deletions readthedocs/templates/core/project_detail_right.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ <h3>{% trans "Last Built" %}</h3>
<span class="build-state build-state-failing">{% trans "failed" %}</span>
{% endif %}
{% else %}
Currently Building
{% trans "Currently Building" %}
{% endif %}
{% else %}
No builds yet
{% trans "No builds yet" %}
{% endif %}
{% endwith %}
</p>
Expand Down Expand Up @@ -61,16 +61,25 @@ <h3>{% trans "Badge" %}</h3>


{% block tags %}
{% if project.tags.count %}
<h3>{% trans "Tags" %}</h3>
<p>
{% for tag in project.tags.all %}
<a href="{% url "projects_tag_detail" tag.slug %}">{{ tag.name }}</a>{% if forloop.last %}{% else %}, {% endif %}
{% empty %}
<span class="quiet">{% trans "No tags" %}</span>
{% endfor %}

{% if project.tags.count %}
Copy link
Member

Choose a reason for hiding this comment

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

I saw that we are using .count in some places where we don't need the number but we want to know the existence. So, maybe it's better to use .exists

Copy link
Member Author

Choose a reason for hiding this comment

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

Hah yea, old habit!

{% for tag in project.tags.all %}
<a href="{% url "projects_tag_detail" tag.slug %}">{{ tag.name }}</a>{% 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 %}
Copy link
Member

Choose a reason for hiding this comment

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

I don't remember this exactly but, can we just use the url tag like this to create a local variable? don't we need the with tag for this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, it works!

Copy link
Member Author

Choose a reason for hiding this comment

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

{% blocktrans %}
Add some in your <a href="{{ edit_url }}">project settings</a>.
{% endblocktrans %}
{% endif %}
{% endif %}

</p>
{% endif %}
{% endblock %}

{% block privacy-level %}
Expand Down