-
-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
1bebda0
Add tests
stsewd e60d997
Add hidden attribute
stsewd 04ff029
Update form
stsewd 645308d
Update queryset
stsewd 526a023
Filter hidden versions from footer and search
stsewd 46c59bf
Add hidden attribute to API v3
stsewd 2326598
Update docs
stsewd 8537331
Migrate protected versions to be hidden
stsewd 6b04db1
Merge branch 'master' into implement-hidden-state-for-versions
stsewd 2768158
Apply suggestions from code review
stsewd c2b9350
Use include_hidden
stsewd 055d862
Improve docs
stsewd ee486ba
Merge branch 'master' into implement-hidden-state-for-versions
stsewd 17a28eb
Improve docs
stsewd dfedc8b
Add guide
stsewd 3bcf9fe
Try using crispy forms for better UX
stsewd 5f3444f
Merge branch 'master' into implement-hidden-state-for-versions
stsewd 7058768
Fix migrations
stsewd 60e12d5
Merge branch 'master' into implement-hidden-state-for-versions
stsewd 5303da4
Merge branch 'master' into implement-hidden-state-for-versions
stsewd 27f8311
Merge branch 'master' into implement-hidden-state-for-versions
stsewd ea1f8ba
Apply suggestions from code review
stsewd 2419877
Merge branch 'master' into implement-hidden-state-for-versions
stsewd bc30c5e
Extension
stsewd a4c59ce
Fix migrations
stsewd 649c90f
Avoid downtime
stsewd ced02ad
Fix form
stsewd a78d500
Merge branch 'master' into implement-hidden-state-for-versions
stsewd c69ad79
Update migrations
stsewd a85c1f1
Disallow hidden versions on robots.txt
stsewd bd476a7
Mention robots.txt in docs
stsewd a640499
Add comments to robots.txt
ericholscher 965dfc0
Fix tests
ericholscher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not 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/`` | ||
|
||
Check the docs about :ref:`versions' states <versions:States>` for more information. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -220,6 +220,7 @@ class Meta: | |
'ref', | ||
'built', | ||
'active', | ||
'hidden', | ||
'type', | ||
'downloads', | ||
'urls', | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
readthedocs/api/v3/tests/responses/projects-versions-detail.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
readthedocs/builds/migrations/0018_add_hidden_field_to_version.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', '0017_builds_deterministic_order_index'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='version', | ||
name='hidden', | ||
field=models.BooleanField(null=True, default=False, help_text='Hide this version from the version (flyout) menu and search results?', verbose_name='Hidden'), | ||
), | ||
] |
20 changes: 20 additions & 0 deletions
20
readthedocs/builds/migrations/0019_migrate_protected_versions_to_hidden.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
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) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('builds', '0018_add_hidden_field_to_version'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(forwards_func), | ||
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do we actually want this? It doesn't make
hidden
very hidden, I think.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.
Yeah. However, if we hide the versions from there, you can't un-hide them. Although, we could show
hidden
versions in that list if you are an admin of the project.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.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
#6935