-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Implement hidden state for versions #6792
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 21 commits
1bebda0
e60d997
04ff029
645308d
526a023
46c59bf
2326598
8537331
6b04db1
2768158
c2b9350
055d862
ee486ba
17a28eb
dfedc8b
3bcf9fe
5f3444f
7058768
60e12d5
5303da4
27f8311
ea1f8ba
2419877
bc30c5e
a4c59ce
649c90f
ced02ad
a78d500
c69ad79
a85c1f1
bd476a7
a640499
965dfc0
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 @@ | ||
Hide a Version and Keep its Docs Online | ||
======================================= | ||
|
||
If you manage a project with a lot of versions, | ||
the version (flyout) menu of your docs can be easily overwhelmed and hard to navigate. | ||
|
||
.. figure:: /_static/images/guides/flyout-overwhelmed.png | ||
:align: center | ||
|
||
Overwhelmed flyout menu | ||
|
||
You can deactivate the version to remove its docs, | ||
but removing its docs isn't always an option. | ||
To don't list a version in the flyout menu while keeping its docs online, you can mark it as hidden. | ||
Go to the :guilabel:`Versions` tab of your project, click on :guilabel:`Edit` and mark the ``Hidden`` option. | ||
|
||
Users that have a link to your old version will still be able to see your docs. | ||
And new users can see all your versions (including hidden versions) in the versions tab of your project at ``https://readthedocs.org/projects/<your-project>/versions/`` | ||
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. Do we actually want this? It doesn't make 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. Yeah. However, if we hide the versions from there, you can't un-hide them. Although, we could show 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.
Hmm, yeah. Not sure, I mean, users will only be able to get there by search results on google or old links, not from the project. I'll create an issue to discuss that. 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. |
||
|
||
Check the docs about :ref:`versions' states <versions:States>` for more information. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -219,6 +219,7 @@ class Meta: | |
'ref', | ||
'built', | ||
'active', | ||
'hidden', | ||
'type', | ||
'downloads', | ||
'urls', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 2.2.11 on 2020-03-18 01:47 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('builds', '0015_uploading_build_state'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='version', | ||
name='hidden', | ||
field=models.BooleanField(default=False, help_text='Hide this version from the version (flyout) menu and search results?', verbose_name='Hidden'), | ||
), | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Generated by Django 2.2.11 on 2020-03-18 18:27 | ||
stsewd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
from django.db import migrations | ||
|
||
|
||
def forwards_func(apps, schema_editor): | ||
"""Migrate all protected versions to be hidden.""" | ||
Version = apps.get_model('builds', 'Version') | ||
Version.objects.filter(privacy_level='protected').update(hidden=True) | ||
stsewd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('builds', '0016_add_hidden_field_to_version'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(forwards_func), | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{% load i18n %} | ||
|
||
<p> | ||
{% blocktrans trimmed with docs_link="https://docs.readthedocs.io/page/versions.html#states" %} | ||
Learn more about states <a href="{{ docs_link }}">here</a>. | ||
{% endblocktrans %} | ||
</p> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{% load i18n %} | ||
|
||
<p> | ||
<input style="display: inline;" type="submit" value="{% trans "Save" %}"> | ||
{% trans "or" %} | ||
<a href="{% url "wipe_version" version.project.slug version.slug %}">{% trans "wipe "%}</a> | ||
</p> |
Uh oh!
There was an error while loading. Please reload this page.